Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. # Making a clock that works on different time.
  2.  
  3.  
  4. def seconds(time_string, from_seconds_in_minute):
  5. """This will change the minutes and seconds into seconds:
  6.  
  7. The following parameters are:
  8. :param time_string:
  9. :param from_seconds_in_minute:
  10. :return: representation of minutes and seconds in seconds
  11. """
  12. m, s = time_string.split(':')
  13. if s <= '60':
  14. return int(m) * from_seconds_in_minute + int(s)
  15.  
  16.  
  17. def convert(time_string, from_seconds_in_minute, to_seconds_in_minute):
  18. """This function will be dealing with the following:
  19.  
  20. Changing to 60 metric system into a different system.
  21. :param time_string:
  22. :param from_seconds_in_minute:
  23. :param to_seconds_in_minute:
  24. :return:
  25. """
  26. return 1
  27.  
  28.  
  29. if __name__ == '__main__':
  30.  
  31. print(seconds("14:25", 50))
  32. print(convert("12:12", 20, 30)) # = > "08:12"
  33. print(convert("03:40", 60, 3)) # = > "73:01"
  34. print(convert("00:01", 60, 60))
  35. print(convert("03:61", 60, 3))
  36. print(convert("00:00", 60, 3))
  37. print(convert("03:61", 60, 3))
  38. print(convert("03:61", 60, 3))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement