3.1. Python exampleΒΆ

Note

Python and Ipython notebook versions of code (.py .ipynb).

This example illustrates some Python code:

1>>> total_secs = 7684
2>>> hours = total_secs // 3600
3>>> secs_still_remaining = total_secs % 3600
4>>> minutes =  secs_still_remaining // 60
5>>> secs_finally_remaining = secs_still_remaining  % 60
6>>> print "Hrs =", hours, "mins =", minutes, "secs =", secs_finally_remaining
7Hrs = 2 mins = 8 secs =  4