摘要: # x + y + z = 100 # 5x + 3y + z/3 = 100 for x in range(1, 20): for y in range(1, 33): z = 100 - y - x if z % 3 == 0 and 5 * x + 3 * y + z / 3 == 100: print('公鸡:', x, '... 阅读全文
posted @ 2017-04-11 23:59 beiguuu 阅读(385) 评论(0) 推荐(0) 编辑
摘要: 迭代器的应用 文件名:a.txt,文件内容如下: apple 10 3 tesla 100000 1 mac 3000 2 lenovo 30000 3 chicken 10 3 实现功能:cat a.txt |grep apple 要求1:定义迭代器函数cat 要求2:定义迭代器函数grep 要求 阅读全文
posted @ 2017-04-11 22:54 beiguuu 阅读(270) 评论(1) 推荐(0) 编辑