Find minimum of given integer values

Problem Statement

Given a list or sequence of integer values via the standard input, find the minimum value.

Input

The first line of input contains a sequence of integer values separated by space.

Output

Print the minimum of given integer values.

As is

The boilerplate code is already there to read a sequence of integer values via input from user, in the main() function. Also it calls the minimum_of_values() function, and prints the returned value. Do not edit this code.

To do ✍

minimum_of_values() has one parameter: nums which is a list of integer values. Write code inside the function body to compute the minimum of given integer values in the list, and return the minimum value.

Example 1

Test input

4 8 6 1 7 3

Test output

1

Explanation

1 is the minimum of given integer values.

Useful References

Python Program

# Complete the following function
# Return the minimum of given integers in nums
def minimum_of_values(nums):




# Boilerplate code - Do not edit the following
def main():
    nums = [int(x) for x in input().split()]
    print(minimum_of_values(nums))

if __name__ == "__main__":
    main()

Test case 1

-9
-9

Test case 2

8 421 3 9 2 541 62 210 7
2

Test case 3

87 5 4 22 369 -7 21 -963 821 0
-963

Test case 4

-7 -96
-96
# Complete the following function
# Return the minimum of given integers in nums
def minimum_of_values(nums):
    return min(nums)

# Boilerplate code - Do not edit the following
def main():
    nums = [int(x) for x in input().split()]
    print(minimum_of_values(nums))

if __name__ == "__main__":
    main()
show answer
main.py
⏵︎ Run Tests
Reset
Download
×
Code copied to clipboard successfully 👍