摘要: l = [1, 2, -1, -2, 5, 6, -9]# print([i for i in l if i > 0])ret = filter(lambda item: item > 0, l)print(list(ret))l2 = ["张三", "李四", "张三丰"]print(list(f 阅读全文
posted @ 2022-05-13 21:36 呼长喜 阅读(21) 评论(0) 推荐(0) 编辑
摘要: print(10 * 10)print(pow(10, 3))print(divmod(5, 2))x = 3.1415926print(round(x, 3))print(chr(65))print(chr(97))print(ord("A"))print(ord("a"))# s = {2, 4 阅读全文
posted @ 2022-05-13 21:35 呼长喜 阅读(24) 评论(0) 推荐(0) 编辑
摘要: def add(x, y): return x + y# lambda 形参:返回值# add2 = lambda x, y: x + y# print(add2(1, 2))print((lambda x, y: x + y)(2, 3))print((lambda: 100)()) 阅读全文
posted @ 2022-05-13 21:35 呼长喜 阅读(10) 评论(0) 推荐(0) 编辑