标题:没搞懂这里为啥报错
取消只看楼主
pjun
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2019-9-6
结帖率:0
 问题点数:0 回复次数:0 
没搞懂这里为啥报错
for number in range(100):
    if number%3 == 2 and number%5 == 3 and number%7 == 2:
        print("答曰,这个数是".number)


运行报错
Traceback (most recent call last):
  File "C:/Users/peng/Desktop/python文件/例4.6自主练.py", line 3, in <module>
    print("答曰,这个数是".number)
AttributeError: 'str' object has no attribute 'number'
搜索更多相关主题的帖子: 个数 报错 number and print 
2019-09-09 10:20



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-496746-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.078780 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved