l = [1, 2, 3]
t = (1, 2, 3)
d5 = {1:"one", 2:"two", 3:"three"}
print d5.get(1) #one
print d5.get(5) #None
print d5.get(5, "test") #test
has_key(key) ---判断字典中是否有键key
已有 22658 名学员学习以下课程通过考试
最需教育客户端 软件问题一手掌握
去 App Store 免费下载 iOS 客户端
点击加载更多评论>>