Simple time calculator in Python