Saturday, March 28, 2020

Find the Minimum of 3 numbers using Python

minimum.py
a = int(input("Enter First Number: "))
b = int(input("Enter Second Number: "))
c = int(input("Enter Third Number: "))
min = a if a < b and a < c else b if b < c else c
print("Minimum Value:", min)


Output:
Enter First Number: 10
Enter Second Number: 20
Enter Third Number: 30
Minimum Value: 10

Process returned 0 (0x0)    execution time : 5.773 s
Press [ENTER] to continue...

No comments:

Post a Comment