Created
July 6, 2021 09:21
-
-
Save arsenstorm/4ab81e153147d365dab37b0fa7c9f052 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
activities = ["Running", "Swimming", "Tennis", "Football"] | |
timeExercise = [] | |
number = 0 | |
for i in range(len(activities)): | |
timeAppend = -1 | |
act = activities[i] | |
while True: | |
try: | |
while timeAppend < 0 or timeAppend > 200: | |
timeAppend = int(input("How many minutes do you spend exercising for " + str(act) + "\n>>> ")) | |
break | |
except ValueError: | |
print(">>> You must enter an integer") | |
timeExercise.append(timeAppend) | |
for i in range(len(timeExercise)): | |
number = number + int(timeExercise[i]) | |
average = number/len(activities) | |
print("\n") | |
print("Total time exercising -->", number) | |
print("Average time per exercise -->", average) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment