Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- def timeconvert(stroke, distance, course, toCourse, time):
- def getSeconds(time):
- if re.search("\d{1,2}:", time) != None:
- minutes = re.search("\d{1,2}:", time).group()[:-1]
- seconds = re.search(":\d{1,2}", time).group()[1:]
- else:
- minutes = 0
- seconds = re.search("\d{1,2}\.", time).group()
- if len(re.search("\.\d{1,2}", time).group()[1:]) < 2:
- hundreths = float((re.search("\.\d{1,2}", time).group()[1:])) * 10
- print(hundreths)
- else:
- hundreths = (re.search("\.\d{1,2}", time).group()[1:])
- return (float(minutes) * 60) + (float(seconds)) + (float(hundreths) / 100)
- def getfFactor(course, toCourse, distance, stroke):
- fFactor = 1.11
- course = course.lower()
- toCourse = toCourse.lower()
- stroke = stroke.lower()
- if (course == "lcm" and toCourse == "scm"):
- fFactor = 1.0
- if (course == "lcm" and toCourse == "scy") or (course == "scy" and toCourse == "lcm") and (distance >= 400 and distance <=1000) and stroke != "im":
- fFactor = .8925
- if (course == "scy" and toCourse == "lcm") or (course == "lcm" and toCourse == "scy") and distance >= 1500:
- fFactor = 1.02
- return fFactor
- def increHelper(stroke):
- stroke = stroke.lower()
- if stroke == "fly" or stroke == "butterfly":
- return 70
- if stroke == "back" or stroke == "backstroke":
- return 60
- if stroke == "breast" or stroke == "breaststroke":
- return 100
- if stroke == "free" or stroke == "freestyle":
- return = 70
- def getIncre(stroke, course, toCourse)
- if (course == "scy" and toCourse == "scm") or (course == "scm" and toCourse == "scy"):
- value = 0
- time = "1:58.78"
- 23.1
- print("Time: " + time + "\nIn seconds: " + str(getSeconds(time)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement