Python中如何筛选1到300内非偶数且非7的倍数的数字?
- 内容介绍
- 文章标签
- 相关推荐
本文共计41个文字,预计阅读时间需要1分钟。
pythoni=1j=0while i <300: if i % 2 !=0 and i % 7 !=0: j +=i i +=1print(j)
i = 1j = 0while i <= 300: if i %2 != 0 and i %7 != 0: j += i i += 1print(j)本文共计41个文字,预计阅读时间需要1分钟。
pythoni=1j=0while i <300: if i % 2 !=0 and i % 7 !=0: j +=i i +=1print(j)
i = 1j = 0while i <= 300: if i %2 != 0 and i %7 != 0: j += i i += 1print(j)
