Question

In: Computer Science

Write a program IN PYTHON of the JUPYTER NOOTBOOK that keeps getting a set of numbers...

Write a program IN PYTHON of the JUPYTER NOOTBOOK that keeps getting a set of numbers from user until the user enters "done". Then shows the count, total, and average of the entered numbers.


This should the answer when finished
Enter a number: 55
Enter a number: 90
Enter a number: 12
Enter a number: done
You entered 3 numbers, total is 157, average is 52.33333

Solutions

Expert Solution

Python code:

#accepting first number
num=input("Enter a number: ")
#initializing count as 0
count=0
#initializing total as 0
total=0
#looping till done is entered
while(num!="done"):
#incrementing count
count+=1
#adding num to total
total+=int(num)
#accepting next number
num=input("Enter a number: ")
#printing count,total and average
print("You entered {} numbers, total is {}, average is {:.5f}".format(count,total,total/count))

Screenshot:


Input and Output:


Related Solutions

Python Jupiter Notebook Write a program that keeps getting a set of numbers from user until...
Python Jupiter Notebook Write a program that keeps getting a set of numbers from user until the user enters "done". Then shows the count, total, and average of the entered numbers. Example: Enter a number: 55 Enter a number: 90 Enter a number: 12 Enter a number: done You entered 3 numbers, total is 157, average is 52.33333
Write a program IN PYTHON of the JUPYTER NOOTBOOK Write a Python program that gets a...
Write a program IN PYTHON of the JUPYTER NOOTBOOK Write a Python program that gets a numeric grade (on a scale of 0-100) from the user and convert it to a letter grade based on the following table. A: 90% - 100% B 80% - 89% C 70% - 79% D 60% - 69% F <60% The program should be written so that if the user entered either a non-numeric input or a numeric input out of the 0-100 range,...
Write a Python program which takes a set of positive numbers from the input and returns...
Write a Python program which takes a set of positive numbers from the input and returns the sum of the prime numbers in the given set. The sequence will be ended with a negative number.
Question 3: getting diagnostics, Write a python program   Write the getting diagnostics function, which reports the...
Question 3: getting diagnostics, Write a python program   Write the getting diagnostics function, which reports the most frequent diagnostic from the patients with the highest symptoms similarity returned by the function similarity to patients. See below for an explanation of exactly what is expected. def getting_diagnostics(patient_set : Set[int], diagnostic_by_patient: Dict[int, str]) -> str: """ Returns a string representing the most frequent diagnostic from the set of diagnostics (stored in the dictionary diagnostic_by_patient) of the patient_set (that is a set of...
Python: Using Jupyter Notebook 1. Write code to generate Fibonacci series. Fibonacci numbers – 1, 1,...
Python: Using Jupyter Notebook 1. Write code to generate Fibonacci series. Fibonacci numbers – 1, 1, 2, 3, 5, 8, … 2. Check if a number is an Armstrong number A positive integer is called an Armstrong number of order n if abcd... = a^n + b^n + c^n + d^n + ... In case of an Armstrong number of 3 digits, the sum of cubes of each digits is equal to the number itself. For example: 153 = 1*1*1...
Write a python program that keeps names and email addresses in a dictionary as key-value pairs....
Write a python program that keeps names and email addresses in a dictionary as key-value pairs. The program should display a menu that lets the user look up a person’s email address, add a new name and email address, change an existing email address, and delete an existing name and email address. The program should bind the dictionary and save it to a file when the user exits the program. Each time the program starts, it should retrieve the dictionary...
Using the Python program: a/ Write a program that adds all numbers from 1 to 100...
Using the Python program: a/ Write a program that adds all numbers from 1 to 100 to a list (in order). Then remove the multiples of 3 from the list. Print the remaining values. b/ Write a program that initializes a list with ten random integers from 1 to 100. Then remove the multiples of 3 and 5 from the list. Print the remaining values. Please show your work and explain. Thanks
IN PYTHON Write a program to do the following: Solve the a set of equations as...
IN PYTHON Write a program to do the following: Solve the a set of equations as mentioned in "Zybook 5.20 LAB: Brute force equation solver". Instead of the arithmetic operators use your own function defined in a module named calc. You must provide two files (calc.py, brute_force_solver.py) :- 1) calc.py:- Add function named 'add' instead of using operator '+' [10pts] Add function named 'difference' instead of using operator '-' [10pts] Add function named 'product' instead of using operator '*' [10pts]...
Write a Python program to add, multiply and divide any two numbers.
Write a Python program to add, multiply and divide any two numbers.
Write a python program to sum the prime numbers existing in an array . For instance...
Write a python program to sum the prime numbers existing in an array . For instance , if A = [4, 7, 12, 3, 9] the output should be 10
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT