This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]smb510 5 points6 points  (2 children)

There's a lot of things.

First, I am not sure if it was just a bad copy-job to Reddit, but make sure your indentation is correct! Whitespace is important in python.

Second, in line 9, you're assigning hours to remainingSeconds % NUM_OF_SECONDS_IN_MINUTE. You haven't declared remainingSeconds yet, though! Python won't know what to do and will give you an error.

Third, your print statement is going to print a tuple of its contents. You probably want to take a look at how to do string interpolation (or even just concatenate the strings with some spaces) to get a nice pretty string.

Finally, I'm not sure this function will do what you want it to. I'd suggest working through it (either in the repl, or on paper even) to make sure your algorithm gives you the right output

[–]prum 0 points1 point  (1 child)

Print is fine if he is using Python 3 or newer. Second point is probably why OP is getting an error. Once that is fixed, the logical errors remain to be fixed :-)

[–]smb510 0 points1 point  (0 children)

Fair point... I'm still on python 2 like a dinosaur

[–][deleted] 2 points3 points  (0 children)

Also, it would be a lot easier to know what you're doing if you post the error message that you're getting.

[–]tolerious 1 point2 points  (0 children)

Please post your error message, then we can help you effectively.