[Tutor] Help with modulus.

Luis N globophobe at gmail.com
Tue Nov 27 10:57:53 CET 2007

I'd like the below to be a single line if possible.

hours = metrics.totaltime/3600000
minutes = (metrics.totaltime - 3600000*hours)/60000
seconds = (metrics.totaltime - 3600000*hours - 60000*minutes)/1000

Would it be possible to simplify this with a generator expression e.g.

total_time = tuple((...))

More information about the Tutor mailing list