Write a Python program that reads integer numbers and adds them to a list if they are not already contained in the list (i.e. no duplicate values). When the list contains ten different numbers, the program displays the contents of the list and their average. A sample run is shown below:

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 5PE
icon
Related questions
Question
  1. Write a Python program that reads integer numbers and adds them to a list if they are not already contained in the list (i.e. no duplicate values). When the list contains ten different numbers, the program displays the contents of the list and their average. A sample run is shown below:

Write a Python program that reads integer numbers and adds them to a list if they are not already
contained in the list (i.e. no duplicate values). When the list contains ten different numbers, the
program displays the contents of the list and their average. A sample run is shown below:
Enter a number: 6
Enter a number: 6
Values are: 679 -8 10 70 41 52 69 36
Average: 29.20
Enter a number: 7
Enter a number: 9
Enter a number: -8
Sample output (exercise 3)
Enter a number: 10
Enter a number: 70
Enter a number: 41
Enter a number: 41
Enter a number: 41
Enter a number: 52
Enter a number: 69
Enter a number: 36
Sample input (exercise 3)
Transcribed Image Text:Write a Python program that reads integer numbers and adds them to a list if they are not already contained in the list (i.e. no duplicate values). When the list contains ten different numbers, the program displays the contents of the list and their average. A sample run is shown below: Enter a number: 6 Enter a number: 6 Values are: 679 -8 10 70 41 52 69 36 Average: 29.20 Enter a number: 7 Enter a number: 9 Enter a number: -8 Sample output (exercise 3) Enter a number: 10 Enter a number: 70 Enter a number: 41 Enter a number: 41 Enter a number: 41 Enter a number: 52 Enter a number: 69 Enter a number: 36 Sample input (exercise 3)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Time complexity
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT