摘要: 作用:断言函数运行状态 语法:assert condition,判断condition运行状态,若condition状态为false,则上报错误:AssertionError 阅读全文
posted @ 2019-12-16 20:54 骑白马的猴子 阅读(606) 评论(0) 推荐(0) 编辑
摘要: 1 class Fib(object): 2 3 def __init__(self): 4 self.a,self.b=0,1 5 6 def __iter__(self): 7 return self 8 9 def __next__(self): 10 self.a,self.b=self.b 阅读全文
posted @ 2019-12-16 16:54 骑白马的猴子 阅读(423) 评论(0) 推荐(0) 编辑