mardi 6 juillet 2021

What am I doing wrong with this if statement? [duplicate]

I'm currently learning Python and I'm trying to create an if statement for this but I can only get it to work for month or date not month and date.

date = int(input("Enter Date Here: "))

monthConversion = {
    "Jan": "January",
    "Feb": "February",
    "Mar": "March",
    "Apr": "April",
    "May": "May",
    "Jun": "June",
    "Jul": "July",
    "Aug": "August",
    "Sep": "September",
    "Oct": "October",
    "Nov": "November",
    "Dec": "December",
}

month = monthConversion.get(input("Enter Key Here: "), "Not a valid key")

if date == "26" and month == "January":
    print("That's My Birthday!!")

print(month, date)

Aucun commentaire:

Enregistrer un commentaire