from enum import IntEnum
class Trun(IntEnum):
android = 11
ios = 22
from textwrap import dedent
def Text():
text = dedent("asda"
"sada")
float("inf")
和 float("-inf")
”它们俩分别对应着数学世界里的真负无穷大max_num = float('-inf')
# 找到列表中最大的数字
for i in [23, 71, 3, 21, 8]:
if i > max_num:
max_num = i
#max_num = 71
users = {"tom": 19, "jenny": 13, "jack": None, "andrew": 43}
sorted(users.keys(), key=lambda user: users.get(user) or float('inf'))
#['jenny', 'tom', 'andrew', 'jack']