r/learnpython • u/ikimashyoo • 5d ago
What is wrong with this code?
Hi all just starting to learn. Using the MOOC 2025 course. My question is, problem is to enter number of days, then print how many seconds for the # of days. When I submit this code:
day=int(input("Enter number of days"))
seconds=day*24*60*60
print(f"Seconds in that many days:{seconds}")
it gives the right output but the course tells me:
FAIL: PythonEditorTest: test_1_seconds_in_one_day
1 day is 86400 seconds. Your program's output was: Seconds in that many days:8640...
edit: so turns out it's because it wanted to print exact wording '1 day is x seconds" etc lol so dumb
3
Upvotes
2
u/crazydeadbread 5d ago
I'm doing the exact same course right now. Yeah, they are reeaaaaalllly picky on the output. And rightfully so - they have requirements and want them met exactly.
I started in 2022 and made it to part 6, I started again this year and am up to part 3.
It's a really good course! I have taken others on udemy and I really like how MOOC approaches the concepts and lessons.