We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
老师,我运行了以后就成了找奇数,好像for in没起作用,是for in 在__next__方法下用不了吗?还是哪里错了呀
The text was updated successfully, but these errors were encountered:
__next__() 方法里的逻辑写错了,你可以看看我在这个问题里的回答 #101 ,按照里面的思路再想想。
__next__()
p.s. 仔细看你目前的代码,你目前的逻辑是:对 2~b 之间的整数 a 循环执行,用 a 去除 self.base,除尽了就 break(然后函数就结束了,返回一个 None),除不尽就返回 self.base,这样的话,无论除不除得尽,你的循环都只会执行一次就退出了,这肯定是不对的吧?所以我建议把“判断 n 是否素数”这个功能单独写成一个函数,然后按照我上面给你的 #101 问题里提示的思路去做。
Sorry, something went wrong.
No branches or pull requests
老师,我运行了以后就成了找奇数,好像for in没起作用,是for in 在__next__方法下用不了吗?还是哪里错了呀
The text was updated successfully, but these errors were encountered: