Given two numbers, write a Python code to find the Minimum of these two numbers.
Input: a = 2, b = 4 Output: 2 Input: a = -1, b = -4 Output: -4
Method #1: This is the naive approach where we will compare the numbers using if-else statement and will print the output accordingly.
Method #2: Using min() function
This function is used to find the minimum of the values passed as its arguments.
- Python | Maximum and Minimum in a Set
- Python - Row with Minimum Sum in Matrix
- numpy.minimum() in Python
- Python | Minimum key equal pairs
- Python - Minimum in each record value list
- Python | Index minimum value Record
- Python - tensorflow.math.minimum()
- Python - Minimum in tuple list value
- Python | Minimum Sum of Consecutive Characters
- Python | Cropped list Minimum
- Python - Minimum element indices
- Python | Maximum and Minimum value from two lists
- Python | Consecutive Subsets Minimum
- Python | Row with Minimum element in Matrix
- Python | List of tuples Minimum
- Python - Find minimum of non zero groups
- Python | Minimum value keys in Dictionary
- Python - Minimum value pairing for dictionary keys
- Python - Column Minimum in Tuple list
- Python - Get minimum difference in Tuple pair
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.