"Equal numbers: Given three integers, determine how many of them are equal to each other. The program must print one of these numbers: 3 (if all are the same), 2 (if two of them are equal to each other and the third is different) or 0 (if all numbers are different). " - Python coding question
CODING QUESTION
Given three integers, determine how many of them are equal to each other. The program must print one of these numbers: 3 (if all are the same), 2 (if two of them are equal to each other and the third is different) or 0 (if all numbers are different).
SOLUTION
x=int(input())y=int(input())
z=int(input())
if x==y and y==z:
print(3)
elif x==y or y==z or z==x:
print(2)
else:
print(0)
Input :
10
5
10
Output : 2