1.字典的映射
day=10
# def get_sunday():
# return 'Sunday'
# def get_monday():
# return 'monday'
# def get_tuesday():
# return 'Tuesday'
# def get_defult():
# return "Unkown"
# switcher={
# 0:get_sunday,
# 1:get_monday,
# 2:get_tuesday
# }
# day_name=switcher.get(day,get_defult)()
# print(day_name)
---------------------------------------------------------
2.列表推导式和字典推导式 数字循环是一个gentenerm
students={
'喜小乐':18,
'石敢当':20,
'横小五':15
}
b=(key for key,value in students.items())
print(b)
3.三元表达式
x=2
y=1
r= x if x>y else y
print(r)