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

  

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

1 Expert Approved Answer
Step: 1 Unlock

curnum 1 ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Operating System Questions!