1.7k views
2 votes
Write a Python program whose inputs are three integers, and whose output is the smallest of the three values.

Input
7
15
3

Output
3

User Varman
by
7.8k points

1 Answer

0 votes

Answer:

def smallest_of_three(a, b, c):

return min(a, b, c)

print(smallest_of_three(7, 15, 3))

Step-by-step explanation:

The above program takes three integers as inputs and returns the smallest of the three values using the min() function which takes an iterable of numbers as input and returns the smallest number in it. In this case, we pass the three integers a, b, and c as arguments to the min() function and it returns the smallest of the three.

User Lefteris Bab
by
7.6k points