191k views
3 votes
Write a program that reads in ten numbers from the user and displays the distinct numbers. If a number entered by the user appears multiple times, your program needs to filter the repeated numbers and therefore displaying the repeated numbers only once. For example, if the user enters the number 1, 4, 6, 1, 8, 4, 2, 1, 3,9 then the output of your program should be: 1, 4, 6, 8, 2, 3, 9.

User Avanti
by
4.1k points

1 Answer

3 votes

Answer:

Here you go :)

Step-by-step explanation:

Change this however you'd like:

array = []

for n in range(10):

x = int(input("Enter integer: "))

array.append(x)

dup = set(array)

print(", ".join(str(i) for i in dup))

User Ffmaer
by
4.0k points