Python Practice › Set Programs › Program 14

Maximum element of a set

EasySet Programs · 14 of 48

Write a Python program to find the largest element in a set.

Advertisement
Input
{12, 45, 7, 33}
Output
45

Approach

  1. max().

Solution

Python
print(max({12, 45, 7, 33}))
Output
45

Learn the concept

New to this topic? Read the lesson, then come back.

More set programs

← All 48 Set Programs

Leave a Comment