In this article, we will learn how to get the maximum and minimum element in a set in Python, using the built-in functions of Python.
Input : set = ([8, 16, 24, 1, 25, 3, 10, 65, 55]) Output : max is 65 Input : set = ([4, 12, 10, 9, 4, 13]) Output : min is 4
max() in a Set
The built-in function max() in Python is used to get the maximum of all the elements in a set.
min() in a Set
- Python | Maximum and minimum element's position in a list
- Python | Maximum and Minimum value from two lists
- Python - Maximum and Minimum K elements in Tuple
- Select row with maximum and minimum value in Pandas dataframe
- Calculate the difference between the maximum and the minimum values of a given NumPy array along the second axis
- Find the maximum and minimum element in a NumPy array
- How to get the minimum and maximum value of a given NumPy array along the second axis?
- How to find the maximum and minimum value in NumPy 1d-array?
- Maximum length prefix such that frequency of each character is atmost number of characters with minimum frequency
- PyQt5 – Set minimum window size | setMinimumWidth and setMinimumHeight method
- PyQt5 – How to set minimum size of window | setMinimumSize method
- PyQt5 – Set minimum size of Status Bar
- PyQt5 – Set minimum length for width/height of Status Bar
- PyQt5 - How to set minimum value of progress bar ?
- PyQt5 - Set minimum content length to ComboBox item
- PyQt5 QDateEdit - Removing Minimum Time which can be set
- PyQt5 QDateEdit - Getting Minimum Date Time which can be set
- PyQt5 QDateEdit - Setting Minimum Date Time which can be set
- PyQt5 QDateEdit - Removing Minimum Date Time which can be set
- PyQt5 QDateEdit - Setting Minimum Time which can be set
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.