Smallest of three Numbers in Python

Smallest of three Numbers in Python Homework Sample

Write a program that allows the user to enter 3 numbers. Display the smallest number, and then display how many values are the same. So if the users enters 1,2,3 display 1 is the smallest, and no numbers are the same, but if they enter 4,5,5 display 4 is the smallest and there are 2 values that are the same. For more Python programming assignment help contact us for details.

Solution:

a = int(input(“Enter 1st number: “))
b = int(input(“Enter 2nd number: “))
c = int(input(“Enter 3rd number: “))
smallest = min(a, b, c)
print(“The smallest number is {}”.format(smallest))
if a != b and b != c and c != a:
print(“There are no equal numbers”)
elif a == b and b == c:
print(“There are three equal numbers”)
elif (a == b and b != c) or (a != b and b == c) or (a == c and a != b):
print(“There are two equal numbers”)