Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
1 Create a program that uses a while Loop to read in numbers from the user until the user types 0 wi...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started