Given three integer variables firstInt secondInt and third I
Given three integer variables, firstInt, secondInt and third Int, write a code segment that prints \"The three numbers are distinct when no two of these integers are equal and \"The three numbers are not distinct.\" when at least two of these integers are equal. Your code segment should use no more than three comparisons in producing the correct output and it should work correctly for any three integers.
Solution
Python code:
def func(first,second,third):
if(first != second):
if(second != third):
if(first != third):
print \"The three numbers are distinct!\"
else:
print \"The three numbers are not distinct!\"
func(1,2,3)
func(1,1,2)
func(1,1,1)
sample output:
The three numbers are distinct!
The three numbers are not distinct!
The three numbers are not distinct!
