Programming Examples
Python program to input 3 numbers from user and check these are unique numbers are not
Write a Python program input 3 numbers from user and check these numbers are Unique are Not.
Solutions 1
n1=int(input("Enter Number 1 : "))
n2=int(input("Enter Number 2 : "))
n3=int(input("Enter Number 3 : "))
if n1!=n2!=n3!=n1:
print("All Numbers are Unique ")
else:
print("Two or All are same Numbers")
Output
Enter Number 1 : 1
Enter Number 2 : 2
Enter Number 3 : 2
Two or All are same Numbers
==========================
Enter Number 1 : 1
Enter Number 2 : 2
Enter Number 3 : 1
Two or All are same Numbers
==========================
Enter Number 1 : 2
Enter Number 2 : 3
Enter Number 3 : 4
All Numbers are Unique
==========================
Enter Number 1 : 1
Enter Number 2 : 3
Enter Number 3 : 3
Two or All are same Numbers