Created
December 21, 2016 23:43
-
-
Save jdkato/072f400daef57191283123351fad328e to your computer and use it in GitHub Desktop.
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
import datetime | |
tdt = datetime.datetime.strptime('2:30.00', '%M:%S.%f') | |
total = 60 * tdt.minute + (tdt.second + (tdt.microsecond / 1000000.0)) | |
done = False | |
count = 0 | |
times = [] | |
splits = [] | |
while not done: | |
split = input('split: ') | |
if split == '': | |
done = True | |
continue | |
try: | |
dt = datetime.datetime.strptime(split, '%M:%S.%f') | |
except: | |
print('Try again!') | |
continue | |
split = 60 * dt.minute + (dt.second + (dt.microsecond / 1000000.0)) | |
splits.append(round(total - split, 2)) | |
total = split | |
splits.append(round(sum(splits), 2)) | |
print(str(splits).strip('[]').replace(' ', '') + ',') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment