Page 1 of 1

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

Posted: Sun May 15, 2022 1:12 pm
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")