python Notes experience

1. dictionary mapping 
Day 10 =
# DEF get_sunday ():
# return 'the Sunday'
# DEF get_monday ():
# return 'Monday'
# DEF get_tuesday ():
# return 'on 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. list and dictionary derivation is a derivation of digital loop gentenerm
Students. = {
'hi Le': 18,
'stones': 20,
a cross-fifth': 15

}
B = (Key for Key, Students. in value.items ())
Print (B)
3. ternary expressions with
x=2
y=1
r= x if x>y else y
print(r)

Guess you like

Origin www.cnblogs.com/xuzhongtao/p/11306014.html