Last active
January 2, 2020 08:33
-
-
Save revuel/cc28f57485dfa11bec9ec174bf79fc9a to your computer and use it in GitHub Desktop.
Generates random time intervals, for time reporting purposes...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Generates random time intervals """ | |
import random | |
for x in range(30): | |
entry_h = random.randint(8, 10) | |
entry_m = random.randint(0, 59) | |
if entry_h == 10: | |
entry_m = 0 | |
exit_h_lunch = random.randint(13, 14) | |
exit_m_lunch = random.randint(0, 59) | |
entry_h_lunch = exit_h_lunch + 1 | |
exit_h = entry_h + 9 | |
exit_m = entry_m + 30 | |
if exit_m >= 60: | |
exit_h = exit_h + 1 | |
exit_m = abs(60 - exit_m) | |
print( | |
f"{entry_h:02}:{entry_m:02} \t" | |
f"{exit_h_lunch:02}:{exit_m_lunch:02} \t" | |
f"{entry_h_lunch:02}:{exit_m_lunch:02} \t" | |
f"{exit_h:02}:{exit_m:02}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment