Python Time_calculator project testing issues

I am new to coding so I’m assuming I’ve missed something but as far as I’m aware I have correctly coded the time_calculator function but the test module says the code fails every test, I thought it could have been not adding a space before the result but that didn’t work either. Let me know if you can help, Thanks.
image

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0

Challenge: Time Calculator

Link to the challenge:

What errors specifically are you getting? Could you link to your code on replit?

heres the link to it boilerplate-time-calculator-2 - Replit

Function is not returning anything. It’s expected that function returns string, as in the specification. Function is not expected to print anything on it own.

1 Like

alright ive fixed that now its got an issue with the formatting, the actual result is fine but its saying for example (‘6:18 AM’, ‘(20 days later)’) != ‘6:18 AM (20 days later)’ I’m not sure how to make the whole result a single string because its made up of multiple variables like this: (final_time, “(” + str(num_of_days) + " days later)")

So, the print function automatically concats comma separated values, each separated with a space… since you’re not using print anymore, you need to concat all the variables together into one long string with ‘+’, not as a comma separated list of variables and values.

2 Likes

Got it, cheers lads!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.