I have a problem with my add function in my code. Here is my code of this part.
elif user_choice == "A": event = raw_input("Enter event: ") date = raw_input("Enter date (MM/DD/YYYY): ") if (len(date) > 10 or int(date[6:9]) < int(strftime("%Y"))): print "Invalid Date" try_again = raw_input("Try Again? Y for Yes, N for No: ") try_again = try_again.upper() if try_again == "Y": continue else: start == False else: calendar[date] = event print "The event was successfully added." print calendar
It seemed alright to me until I test it. When I enter the actual invalid date, the function work just fine, but after I enter the date that should be a valid one, the program still throws me an invalid message. I don’t know what I did wrong or how should I fix it.