Write the Python code to ask 3 values from the user and print the smallest value using conditional
statements.
Answers
Answered by
1
Answer:
num1=int(input("Enter the first number: "))
num2=int(input("Enter the second number: "))
num3=int(input("Enter the third number: "))
def find_Smallest(): #function definition
if(num1<=num2):
if(num1<=num3):
Smallest=num1
else:
Smallest=num3
else:
if (num2<=num3):
Smallest=num2
else:
Smallest=num3
#display the smallest number
print("Smallest number is", Smallest)
find_Smallest(); #functio call
Similar questions