Question
in Python, how do I get each question to repeat itself if the user enters a number greater or equal to 100? i want that
in Python, how do I get each question to repeat itself if the user enters a number greater or equal to 100? i want that to be unacceptable and the original question asked again for each individual case.
while True: bp=int(input('How many bench press reps did you perform?: ')) if bp >= 100: print('Please enter a number less than 100. You are overtraining!') bp=int(input('How many bench press reps did you perform?: ')) else: break bs=int(input('How many back squat reps did you perform?: ')) if bs>= 100: print('Please enter a number less than 100. You are overtraining!') bs=int(input('How many back squat reps did you perform?: ')) else: break mp=int(input('How many military press reps did you perform?: ')) if mp>=100: print('Please enter a number less than 100. You are overtraining!') mp=int(input('How many military press reps did you perform?: ')) else: break dl=int(input('How many deadlifts did you perform?: ')) if dl>=100: print('Please enter a number less than 100. You are overtraining!') dl=int(input('How many deadlifts did you perform?: ')) else: break
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started