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 value from two lists
- Python | Maximum and minimum element's position in a list
- Select row with maximum and minimum value in Pandas dataframe
- numpy.minimum() in Python
- What is the maximum possible value of an integer in Python ?
- Python | Maximum Sum Sublist
- Python program maximum of three
- numpy.maximum() in Python
- Python | Get key with maximum value in Dictionary
- Python | Minimum value keys in Dictionary
- Python | Find maximum value in each sublist
- Python | Positions of maximum element in list
- Python | Get first element with maximum value in list of tuples
- Python map function to find row with maximum number of 1's
- Python | Consecutive Maximum Occurrence in list
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.