摘要: a = 4b = 5 #第1种c = 0c = aa = bb = c #第2种a = a+bb = a-ba = a-b #第3种a,b = b,a print("a=%d,b=%d"%(a,b)) 阅读全文
posted @ 2017-12-31 23:06 许小伍 阅读(736) 评论(0) 推荐(0) 编辑
摘要: def test(a, b, func): result = func(a, b) print(result) test(10, 15, lambda x, y: x + y) #coding=utf-8 #python2需要加上coding=utf-8 def test(a, b, func): result = func(a, b) return ... 阅读全文
posted @ 2017-12-31 23:02 许小伍 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 1,2分别赋值给a,b,剩下的参数以元组的形式赋值给args 字典形式参数: 传入元组和字典: 阅读全文
posted @ 2017-12-31 22:28 许小伍 阅读(10917) 评论(0) 推荐(1) 编辑
摘要: 添加新的元素 append() insert() extend() +号 删除元素 pop() remove() del xxx[index] 修改 xxx[index] = value 查找 in、not in if value in arr: ...... 阅读全文
posted @ 2017-12-31 14:28 许小伍 阅读(171) 评论(0) 推荐(0) 编辑