Write a Python program to display the name of the month according to the number entered by the user

preview_player
Показать описание
#sssci2022
Write a Python program to display the name of the month according to the number entered by the user
#python
how to create python program
python programming language
play list python program
Telegram Link Computer class 9 course
Telegram Link Computer class 10 course
Telegram Link Computer class Python Language
Telegram Link Bhakti Channel 2022
Рекомендации по теме
Комментарии
Автор

# Get month number from user
month_num = int(input("Enter the month number (1-12): "))

# List of month names
months = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"]

# Check if the input is valid
if 1 <= month_num <= 12:
# Display the corresponding month name
print("The month is:", months[month_num - 1])
else:
print("Invalid month number! Please enter a number between 1 and 12.")

Ourworld