15. Problem to find the minimum element in a set

In this Python set program, we will find the minimum element in a set with the help of the below-given steps.

What is set?
Sets are used to store multiple items in a single variable.
The set is one of 4 built-in data types in Python used to store collections of data.
It is an unordered collection data type that is iterable, mutable and has no duplicate elements.

Minimum element in a set:

Steps to solve the program

1. Create a set using {}.
2. Add some elements in the set.
3. Get the minimum element in a set using min() function.

				
					Set = {10,23,45,66,96,83}
print("Original set1: ",Set)
print("Minimum value: ",min(Set))
				
			

Output :

				
					Original set1:  {96, 66, 10, 45, 83, 23}
Minimum value:  10
				
			

Related Articles

find the maximum element in a set.

find the sum of elements in a set.

Leave a Comment