Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- def main():
- mins = int(input('How long do you intend to workout? '))
- genWorkout(mins)
- def genWorkout(t):
- exercises = ['JJax','SitUps','Pushups','Crunches','Squats','Burpees']
- i=0
- while (t>0):
- if t<5:
- duration = random.randint(1,t)
- else:
- duration = random.randint(1,5)
- if exercises[i] == 'Burpees':
- duration = 1
- t = t - duration
- print(f'Do {duration} mins of {exercises[i]}')
- i=i+1
- #in case you run out of exercises, cycle back to exercise[0]
- if i>len(exercises)-1:
- i=0
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement