max: returns the largest item in an iterable or the largest of 2 or more arguments
min: returns the smallest item in an iterable or the smallest of 2 or more arguments
"""== max =="""max(3,6,8) # 8max([3,4,5]) # 5max("hello world") # 'w'"""== min =="""min(1,3) # 1min((1,3)) # 1
Example
names = ['Arya', 'Samson', 'Dora', 'Tim', 'Ollivander']min(names) # 'Arya'# the shortest length among the namesmin(len(name) for name in names)""" Using the key parameter """# getting the longest namemax(names, key = lambda name:len(name))# lambda will take each name and return len(name), and we'll use that to judge the max