咦... 奇怪了...
本帖最后由 fllintel 于 2011-05-18 14:12 编辑
复制代码
为什么还会打印1~0啊?
- num='1234567890'
- for i in num:
- if i == 3:
- continue
- else:
- print i
作者: fllintel 发布时间: 2011-05-18
晕... 我傻了... 沉了吧
作者: fllintel 发布时间: 2011-05-18
本帖最后由 ccporxy 于 2011-05-18 14:24 编辑
num='1234567890'
num is a str object
for i in num:
i is also a str object
if i == 3:
convert to if ord(i) == 3:
Solution: if int(i) == 3:
num='1234567890'
num is a str object
for i in num:
i is also a str object
if i == 3:
convert to if ord(i) == 3:
Solution: if int(i) == 3:
作者: ccporxy 发布时间: 2011-05-18
回复 ccporxy
yeah.... I see thx~~
yeah.... I see thx~~
作者: fllintel 发布时间: 2011-05-18