网站首页 站内搜索

搜索结果

查询Tags标签: MyRange,共有 2条记录
  • python 自定义MyRange 2(yield)

    class MyRange:def __init__(self, stop):self.__stop = stopdef __iter__(self):# yield 作用:将下列代码改为迭代器模式的代码# 生成迭代器代码 的的大致规则# 1.将yield以前的语句定义在next方法中# 2.将yield后面的数据作为next方法返回值number = 0while number <…

    2021/11/28 22:11:20 人评论 次浏览
  • python 自定义MyRange 2(yield)

    class MyRange:def __init__(self, stop):self.__stop = stopdef __iter__(self):# yield 作用:将下列代码改为迭代器模式的代码# 生成迭代器代码 的的大致规则# 1.将yield以前的语句定义在next方法中# 2.将yield后面的数据作为next方法返回值number = 0while number <…

    2021/11/28 22:11:20 人评论 次浏览
扫一扫关注最新编程教程