Question: IN PYTHON 3+ Q1) Write a program that reads a list of words (make sure the input statement is inside a loop). Keep asking the

IN PYTHON 3+

Q1) Write a program that reads a list of words (make sure the input statement is inside a loop).

Keep asking the user if they want to continue adding another word, until they say N. Make sure you input each word into a list.

Then, outside the loop, when the user said N to more inputs. Select a random word from the list and print it out. You will need to use the function random.choice(alist) and don't forget the import statement (import random)

Q2) Write the following program. The program should fill a list with integers that the user provides.

You should have a loop that continues if the user wants to do the program multiple times.

In an inner loop, ask the user to input an integer value, test each value to make sure it is an integer with the try-except we used last week, then put each value into a list. Then ask the user if they want to enter another value.

When you are done entering the values in the inner loop:

Sum all the integers in the list and print the result (with words, dont just say a number).

Find the largest and smallest value - you can use max( ) &min( ) and print the results.

Sorts the list - print the result

Make sure you have a main().

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!