Untitled

mail@pastecode.io avatar
unknown
python
3 years ago
553 B
4
Indexable
Never
def current_age() -> int:
    birthDate = input("Enter your birthday in the form mm/dd/yyyy: ")
    birthList = birthDate.split("/")
    birthList[0] = birthList[0].strip("0")
    birthList[0] = int(birthList[0])
    birthList[1] = int(birthList[1])
    birthList[2] = int(birthList[2])
    currentDateList = [3,18,2022]
    age = currentDateList[2] - birthList[2]
    if(birthList[0] == currentDateList[0] and birthList[1] == currentDateList[1]):
        print("Happy Birthday!")
        print(age)
    else:
        print(age-1)