Python Coding-While Loops (In PyCharm Community edition) Create a while loop that SUMS up ALL the numbers given from an initial number and an ending number. Example would be : Input1 : What is...


Python Coding-While Loops



(In PyCharm Community edition)




Create a while loop that SUMS up ALL the numbers given from an initial number and an ending number.




Example would be :



Input1
: What is the first number? 0



Input2
: What is the last number? 3




DO NOT SHOW but these are the computations inside the code : 0 + 1 + 2 + 3 = 6







This is the Output
: The sum of all the number from 0 to 3, is 6




In the code you are going to use a total variable and add each additional time it runs through the loop to that total.


REMEMBER the assignment from the first unit of programming where we used this formula :




BUT
you are going to create your own method using a while loop to emulate what formula accomplishes WITHOUT using this formula. The user will put in the first number and the last to be SUMMED - you will use the while loop to calculate all of the additions leading to the final number.





May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here