Question: Create a program that uses a while loop to read in numbers from the user until the user types O, without doing anything else
Create a program that uses a while loop to read in numbers from the user until the user types O, without doing anything else with the numbers. 2. Extend the program by creating an empty list before the while loop. Next, change the loop so that for each run through it stores the number the user enters in this list. 3. After the while loop is finished, write a for loop that goes through the list and prints each individual element. 4. Extend the program with a variable minSum. Then write a new for loop that goes through the list you created earlier and adds the value of each number to minSum. (Hint: +=). Then print the sum to the user. 5. Use two separate for loops to find respectively the smallest and the largest element in the list, and print these. Here, you must arrive at the smallest and largest number in the list without using min() or max().
Step by Step Solution
3.53 Rating (150 Votes )
There are 3 Steps involved in it
1 Create a program that uses a while Loop to read in numbers from the user until the user types 0 wi... View full answer
Get step-by-step solutions from verified subject matter experts
