Question: In []: Write a while loop that adds the first 50 numbers (from 1 to 50, inclusive) together. To do so, use a while
![In []: Write a while loop that adds the first 50 numbers](https://dsd5zvtm8ll6.cloudfront.net/questions/2024/03/65fbfd666e82b_1711013221718.jpg)
In []: Write a while loop that adds the first 50 numbers (from 1 to 50, inclusive) together. To do so, use a while loop that continues while the condition of cur num being less than or equal to stop_num is True. Inside the loop, it should add cur_num to the running total variable, and then add 1 to cur_num. Make sure to check at the end that the value of total reflects the total summation. In []: assert type (cur_num) == int assert type (total) == int # This will check that the cur_num increment variable ended at the right value assert cur_num == 51
Step by Step Solution
There are 3 Steps involved in it
curnum 1 ... View full answer
Get step-by-step solutions from verified subject matter experts
