Can someone do this python program? Write a function that accepts a list of five numbers from a user and prints the length, sum, average, and largest number of the list.
def calculate(list1):
count = 0
sumVal = 0
largest = list1[0]
for i in list1:
count = count + 1
sumVal = sumVal + i
if i > largest:
largest = i
print("Average is : ", (sumVal)/count)
print("Sum is : ", sumVal)
print("Length is : ", count)
print("Largest is : ", largest)
list1 = []
for i in range(5):
n = int(input("Enter the number: "))
list1.append(n)
print(list1)
calculate(list1)
Output:
Python 3.6.1 (default, Dec 2015, 13:05:11)
[GCC 4.8.2] on linux
Enter the number: 10
Enter the number: 20
Enter the number: 4
Enter the number: 55
Enter the number: 7
[10, 20, 4, 55, 7]
Average is : 19.2
Sum is : 96
Length is : 5
Largest is : 55
Please make sure the code is indented.

Can someone do this python program? Write a function that accepts a list of five numbers...
#Python 1.Write a function called difference() that accepts a list of numbers from the user and returns the difference between the largest and the smallest numbers in the list as follows: >>> difference() Please enter a list: [100, 102, 106, -10] 116 >>> difference() Please enter a list: [1,2,3,4,5,6,7,8,9,10] 9 >>>
PYTHON CODE
In a program, write a function that accepts two arguments: a
list, and a number n. Assume that the list contains numbers. The
function should display all of the numbers in the list that are
greater than the number n. Output should look like:
Number: 5 List of numbers: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] List of numbers that are larger than 5: [6, 7, 8, 9, 10]
1) Translate the following equation into a Python assignment statement 2) Write Python code that prints PLUS, MINUS, O ZERO, depending on the value stored in a variable named N. 3) What is printed by: 3 - 1 while 5: while 10 Print ) Page 1 of 9 4) Write a Python while loop that reads in integers until the user enters a negative number, then prints the sum of the numbers. 1-2 of 9 4) Write a Python while...
PYTHON: Using Lists and Arrays! 5. In a program, write a function that accepts two arguments: a list, and a number n. The program should generate 20 random numbers, in the range of 1 through 100, and assign each number to the list. The program should also ask the user to pick a number from 1 through a 100 and assign that number to n. The function should display all of the number in the list that are greater than...
python
In a program, write a function that accepts two arguments: a list, and a number n. Assume that the list contains numbers. The function should display the number n, the list of numbers, and a sub list of all the numbers in the list that are greater than the number n. Initialize the list and the number n in the main function of your code and call your function, passing the list and number as arguments. Run your code...
python In a program, write a function named roll that accepts an integer argument number_of_throws. The function should generate and return a sorted list of number_of_throws random numbers between 1 and 6. The program should prompt the user to enter a positive integer that is sent to the function, and then print the returned list.
Write a python program that generates a list of 50 random numbers. The program should display (with labels) the sum, average, largest, and smallest of the list along with the list before and after sorting. Bonus: Find the mode (if any)
Write a python program (recursive.py) that contains a main() function. The main() should test the following functions by calling each one with several different values. Here are the functions: 1) rprint - Recursive Printing: Design a recursive function that accepts an integer argument, n, and prints the numbers 1 up through n. 2) rmult - Recursive Multiplication: Design a recursive function that accepts two arguments into the parameters x and y. The function should return the value of x times...
Write a python function that can find the average of given list of numbers. It prints all numbers whose values is less than the average on the screen. Demonstrate with three example data on how it works?
For Python debugExercise12.py is a recursive function that accepts an integer argument, n, and prints the numbers 1 up through n. By debugging these programs, you can gain expertise in program logic in general and the Python programming language in particular. def main(): # Local variable number = 0 # Get number as input from the user. number = int(input('How many numbers to display? ')) # Display the numbers. print_num(number) # The print_num function is a a recursive function #...