摘要: assert语句是一种插入调试断点到程序的一种便捷的方式。 assert 3 == 3 assert 1 == True assert (4 == 4) print(' ') assert (3 == 4) ''' 抛出AssertionError异常,后面程序不执行 ''' print(' ') 阅读全文
posted @ 2020-02-14 15:23 唯一客服系统开发笔记 阅读(1088) 评论(0) 推荐(0) 编辑
摘要: 在python 判断语句中 None, False, 空字符串"", 0, 空列表[], 空字典{}, 空元组()都相当于 False not None == not False == not '' == not 0 == not [] == not {} == not () 需要注意的是'0'这个 阅读全文
posted @ 2020-02-14 15:12 唯一客服系统开发笔记 阅读(5752) 评论(0) 推荐(0) 编辑
摘要: update() 函数把字典dict2的键/值对更新到dict里。如果后面的键有重复的会覆盖前面的语法dict.update(dict2) dict = {'Name': 'Zara', 'Age': 7}dict2 = {'Sex': 'female','Name':'zhangsan'}dict 阅读全文
posted @ 2020-02-14 11:32 唯一客服系统开发笔记 阅读(1501) 评论(0) 推荐(0) 编辑