Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need a help in python and thanks Write a program that does the following: 1. The program asks the user to enter 3 integers.

i need a help in python and thanks
image text in transcribed
Write a program that does the following: 1. The program asks the user to enter 3 integers. a. The program must store the integers in a list. 2. The program must print the list as a list. (30 points) (10 points) 3. The program must print the middle number in the list. (10 points) 4. The program must print how many numbers are in the list. a. Do not hard code 3. 5. The program must print the smallest number in the list. (10 points) 6. The program must print the largest number in the list. (10 points) 7. The program must print the sum of all numbers in the list. (10 points) 8. The program must print the average of all numbers in the list. (10 points) (10 points) Hints: The average of a set of numbers is: (the sum of the numbers)/ ( how many numbers are summed) There are numerous functions and methods that manipulate lists or return values based upon the contents of a list. They are discussed in your ZyBooks Chapter 3.2. Some of theserare: - Directly Access my list my list =[1,2.2. 'Hi '] \# Create a list - x=my list[0] \# Copy a list item to a variable - my_list[2] =5. \# change a list item - Methods to manipulate lists my_list.append(item) \# add an item to the end of my_list my_list.pop(index) \# remove item[index] from my_list my_list.remove(val) \# remove the first item whose value is val from my_list - Methods that return values based upon the list contents x= my_list.index(val) \# returns index of item whose value is val in my_list - x=my _list.count(val) \# returns the number of items in my_list whose value is val - Functions that return values based upon the list contents X= len (my_list) \#returns the number of items in my_list x=min(my_list) \# returns the smallest value in my_list x=max (my_list) \# returns largest value in my_list x=sum(my_list) \# returns the sum of the items in my_list

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions