Python Practice › Set Programs › Program 14
Maximum element of a set
Write a Python program to find the largest element in a set.
Input
{12, 45, 7, 33}Output
45
Approach
max().
Solution
print(max({12, 45, 7, 33}))Output
45
Learn the concept
New to this topic? Read the lesson, then come back.