例2.9 字典的get()方法使用示例
Dict={'age':18,'score':[98,97],'name':'Zhang','sex':'male'}
print(Dict['age'])
print(Dict.get['age'])
print(Dict.get('address','Not Exists.'))
print(Dict['address'])
print("學號:2023310143004")
例2.9 字典的get()方法使用示例
Dict={'age':18,'score':[98,97],'name':'Zhang','sex':'male'}
print(Dict['age'])
print(Dict.get['age'])
print(Dict.get('address','Not Exists.'))
print(Dict['address'])
print("學號:2023310143004")