Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def splitplace(a, b):
- import time
- text= open('C:\Users\[USER]\Desktop\splits.txt', 'r')
- lines = []
- _3k=[]
- _3k_2=[]
- _5k=[]
- time3k=[]
- time5k=[]
- threeplace=1
- threetied=0
- fiveplace=1
- fivetied=0
- for line in text:
- lines.append(line)
- for i in lines:
- temp=i.split()
- _3k.append(temp[1])
- for i in lines:
- temp=i.split()
- _5k.append(temp[3])
- for i in _3k:
- _3k_2.append(i.replace(";", ""))
- _3k=_3k_2
- for i in _3k:
- time3k.append(time.strptime(i, "%M:%S"))
- for i in _5k:
- time5k.append(time.strptime(i, "%M:%S"))
- threetime = a
- fivetime = b
- threetime = time.strptime(threetime, "%M:%S")
- fivetime = time.strptime(fivetime, "%M:%S")
- for i in time3k:
- if i.tm_min<threetime.tm_min:
- threeplace=threeplace+1
- elif i.tm_min==threetime.tm_min:
- if i.tm_sec<threetime.tm_sec:
- threeplace=threeplace+1
- elif i.tm_sec==threetime.tm_sec:
- threetied=threetied+1
- for i in time5k:
- if i.tm_min<fivetime.tm_min:
- fiveplace=fiveplace+1
- elif i.tm_min==fivetime.tm_min:
- if i.tm_sec<fivetime.tm_sec:
- fiveplace=fiveplace+1
- elif i.tm_sec==fivetime.tm_sec:
- fivetied=fivetied+1
- print("Your place at the 3k was " +str(threeplace))
- print("You were tied with " +str(threetied)+ " at the 3k")
- print("Your place at the 5k was " +str(fiveplace))
- print("You were tied with " +str(fivetied)+ " at the 3k")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement