Question: ICW: Loops In Spyder (python) write the code for the following loops. Use print statements to test your code. Write a while loop in pseudocode

ICW: Loops

In Spyder (python) write the code for the following loops. Use print statements to test your code.

  1. Write a while loop in pseudocode that sums all the numbers from 1 to 10.

2. Write a while loop that sums only the even numbers from 1-10.

3. Write a loop that sums all the numbers from 1 to n, where n is a value given to you by the user.

4. Write a loop that sums all the numbers from n down to 1, where n is a value given to you by the user.

5. Write a loop that calculates n! (n factorial, ex: 4! = 1x2x3x4) where n is a value given to you by the user.

6. Write a loop that sums all the numbers from m to n, where m and n are both user given values.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!