+ 3
Ask for the user's birthdate (dd.mm.yyyy) and print the date with the month in str
input 20/11/1998 output "u were born in november 20 in the year of 1998" My question is: How do i get the part of the string "20/11/1998" to create the variables day = "1st n 2nd 'letters' from the str", month = " 4th n 5th 'letters'" and year = "7th, 8th, 10th n 10th 'letters'"?
2 Réponses
+ 13
day, month, year = input("Enter birthdate in the format dd/mm/yyyy: ").split("/")
+ 2
yeap, works just fine! Tnks!!!