l1 = [1,2,3,4]
print(max(l1))
dict1 = {"zhagn":18,"li":20,"wang":22}
value = dict1.values()
print(max(value))
法二:
person = {"li": 18, "wang": 50, "zhang": 20, "sun": 22}
m = 'li'
for key in person.keys():
if person[m] < person[key]:
m = key
print(f'{m}\t{person[m]}')
str1 = input('input string:')
str2 = input('input string:')
str3 = input('input string:')
print(str1, str2, str3)
if str1 > str2:
str1, str2 = str2, str1
if str1 > str3:
str1, str3 = str3, str1
if str2 > str3:
str2, str3 = str3, str2
print('after being sorted.')
print(str1, str2, str3)