I am experiencing a persistent failure with the "How Old" exercise in Part 7. Despite the logic being correct for calculating the difference between the user's birth date and December 31, 1999(the eve of the new milennium), the TMC extension returns the following errors:
HowOldTest: test2_test_with_older_ones (Inputs: 1, 1, 1900)
HowOldTest: test3_test_with_younger_ones (Inputs: 1, 1, 2100)
Code Used:
from datetime import datetime
day = int(input("Day: "))
month = int(input("Month: "))
year = int(input("Year: "))
millennium_eve = datetime(1999, 12, 31)
birth_date = datetime(year, month, day)
if birth_date < millennium_eve:
difference = millennium_eve - birth_date
print(f"You were {difference.days} days old on the eve of the new millennium.")
else:
print("You weren't born yet on the eve of the new millennium.")
I am experiencing a persistent failure with the "How Old" exercise in Part 7. Despite the logic being correct for calculating the difference between the user's birth date and December 31, 1999(the eve of the new milennium), the TMC extension returns the following errors:
HowOldTest: test2_test_with_older_ones (Inputs: 1, 1, 1900)
HowOldTest: test3_test_with_younger_ones (Inputs: 1, 1, 2100)
Code Used:
from datetime import datetime
day = int(input("Day: "))
month = int(input("Month: "))
year = int(input("Year: "))
millennium_eve = datetime(1999, 12, 31)
birth_date = datetime(year, month, day)
if birth_date < millennium_eve:
difference = millennium_eve - birth_date
print(f"You were {difference.days} days old on the eve of the new millennium.")
else:
print("You weren't born yet on the eve of the new millennium.")