Create a program that asks the user for his birthday in the format "Date-Month-Year"
example: "You were born in January"
example: "You were born in January"
# Ask the user for their birthday
birthday = input("Enter your birthday (in the format Date-Month-Year): ")
# Split the birthday into date, month, and year
date, month, year = birthday.split("-")
# Convert the month to its name
months = [
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
]
month_name = months[int(month) - 1]
# Print the month the user was born in
print("You were born in", month_name)
months
list. We store the corresponding month name in the month_name
variable.print
function.