Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import randint
- from statistics import mean
- #Create list to capture time of walks.
- time_of_walks = []
- #Use randint function to simulate time of walks for the week.
- for i in range(0,7):
- time_of_walks.append(randint(30,90))
- print(time_of_walks)
- #Compute average
- print("My average walking time for the week is" + mean(time_of_walks) + " minutes.")
- #Compute shortest walk.
- print("My shortest walk is " + str(min(time_of_walks)) + " minutes.")
- #Compute longest walk.
- print("My longest walk is " + str(max(time_of_walks)) + " minutes.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement