need help with my code I get 63 for totalCount if i put 0 for "How many exercise did you do in the last round, but i ass

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

need help with my code I get 63 for totalCount if i put 0 for "How many exercise did you do in the last round, but i ass

Post by answerhappygod »

need help with my code
I get 63 for totalCount if i put 0 for "How many exercise did
you do in the last round, but i assume i'm supposed to put 3
instead of 0 according to the instruction below.
instruction:
"Boot camp consisted of an interesting “descending ladder”
workout today. Participants did 18 exercises in the first round and
three less in each round after that until they did 3 exercises in
the final round. How many exercises did the participants do during
the workout? (63 for testing purposes) Write the code using 'for
loop' so that it provides a complete, flexible solution toward
counting repetitions. Ask the user to enter the starting point,
ending point and increment (change amount)."
code i have in python:
startingPnt=int(input("How many exercises did you do in the
first round?: "))
increment=int(input("How many exercises did you add in the next
round?: "))
endingPnt=int(input("How many exercises did you do in the last
round?: "))
totalCount=0
for excercise in range(startingPnt, endingPnt, increment):
print("You did",excercise,"reps this round")
totalCount += excercise
print('you did',totalCount,"reps")
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply