Write A Program To Input eight Number From The User And Display All The Unique Number (In A Set).

 Write A Program To Input eight Number From  The User  And Display All The Unique Numbers.

Code :

num1 = int(input("Enter number 1\n"))
num2 = int(input("Enter number 2\n"))
num3 = int(input("Enter number 3\n"))
num4 = int(input("Enter number 4\n"))
num5 = int(input("Enter number 5\n"))
num6 = int(input("Enter number 6\n"))
num7 = int(input("Enter number 7\n"))
num8 = int(input("Enter number 8\n"))

s = {num1, num2, num3, num4, num5, num6, num7, num8}
print(s)

Output:

Enter number 1
25
Enter number 2
33
Enter number 3
89
Enter number 4
493
Enter number 5
25
Enter number 6
33
Enter number 7
85
Enter number 8
99
{33, 99, 493, 85, 89, 25}


Download Code







Comments

Popular posts from this blog

Write A Python Program, Create n Empty Dictionary Allow 4 Friends To, Enter Their Favorite Programming Language As values and User Keys as their Name Assume That The Names Are Unique.

Write Python Program To Store Seven Fruits Name In a List Enter By The User