Title: Exercise How Old (Part 7) - Persistent test failure on test2 and test3

Open
#27 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Quiet
Tech stack
python
Domain
testing

Research direction

Reproduce the failure through the TMC extension using the How Old exercise and the reported inputs. Start by inspecting HowOldTest, especially test2_test_with_older_ones and test3_test_with_younger_ones, and compare their expected output with the submitted program's output. Done means both tests pass for the reported cases.

Written by the indexing model from the issue text.

Description

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.")

Dominant language
JavaScript
Stars
77
Forks
30
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rage/programming-26

All issues in rage/programming-26

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.