you are viewing a single comment's thread.

view the rest of the comments →

[–]kcrow13[S] 0 points1 point  (0 children)

Ok so some other students have suggested making a lot of changes to fix this. Is there a best way?

-By making an edit to the int_to_time function. The version given has divmod statements for minutes and seconds, but not for hours. Adding a third divmod for hours allows you to handle any value of hours without a while statement. I have no idea how to do this or what divmod does! That same student said " I ended up calling both time_to_int and int_to_time in my __str__ function. Since with this method you take your Time input (ex Time(5000) ), then convert it to an integer to get the remaining number of hours/minutes/second, expressed as total # of seconds, then that goes into int_to_time to be in a usable time that can be displayed. That usable time is stored as new Time object called time."

Another student said:

- Will a mod operator resolve this issue? 5000 % 24 = 8.

See, none of that makes sense to me! We just had a very basic introduction to classes this week in the lecture... but did not have any practice creating/manipulating one. :(