0

I cant get my function to process and print HELP

Im using repl from google to test my code. It doesnt print the function from datetime import datetime, date print("Your date of birth (mm yyyy)") date_of_birth = datetime.strptime(input("--->"), "%m %Y") def calculate_age(born): today = date.today(input("Enter today's date: ")) return today.year - born.year - ((today.month) < (born.month)) age = calculate_age(date_of_birth) print(age) calculate_age

3rd May 2020, 5:19 AM
Christian Sandoval
Christian Sandoval - avatar
2 Respostas
+ 2
Did you call it? What error do you get?(if any) Please copy your code to CodePlayground and share the link because it's hard to read in plain text.
3rd May 2020, 5:23 AM
Kevin ★
+ 2
I fixed the code for you, but you should really have attached the code in the SL playground in the first place. date.today() does not need any parameters, it just gives you todays date. Watch where your function ends and stop indenting the lines afterwards (age=...) And the last line does not do anything. https://code.sololearn.com/cvs3UOQ4C4Xn/?ref=app
3rd May 2020, 5:29 AM
Tibor Santa
Tibor Santa - avatar