1square = {2: 4, -3: 9, -1: 1, -2: 4}
2
3# the largest key
4key1 = max(square)
5print("The largest key:", key1) # 2
6
7# the key whose value is the largest
8key2 = max(square, key = lambda k: square[k])
9
10print("The key with the largest value:", key2) # -3
11
12# getting the largest value
13print("The largest value:", square[key2]) # 9
14
1i = max(2, 4, 6, 3)
2
3print(i)
4# Result will be 6 because it is the highest number
1print(max(2, 3)) # Returns 3 as 3 is the largest of the two values
2print(max(2, 3, 23)) # Returns 23 as 23 is the largest of all the values
3
4list1 = [1, 2, 4, 5, 54]
5print(max(list1)) # Returns 54 as 54 is the largest value in the list