V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  swustxxl  ›  全部回复第 1 页 / 共 1 页
回复总数  4
2015-10-04 21:07:51 +08:00
回复了 Ansen 创建的主题 Python python 3 继承内置 list 对象问题
@Kisesy 嗯,确实敲错了,不好意思
不过继续报错,这回是这样的了
Traceback (most recent call last):
File "C:\Python34\AthleteList\AthlelteList.py", line 37, in <module>
print(james.name + "'s fastest times are: " + str(james.top3()))
TypeError: can only concatenate list (not "str") to list
2015-10-04 20:45:42 +08:00
回复了 Ansen 创建的主题 Python python 3 继承内置 list 对象问题
@zzbond0517 关于 list.__int__([])
书中的解释是:初始化所派生的类
2015-10-04 20:42:41 +08:00
回复了 Ansen 创建的主题 Python python 3 继承内置 list 对象问题
代码中, james2.txt 的内容:
James Lee,2002-3-14,2-34,3:21,2.34,2.45,3.01,2:01,2:01,3:10,2-22,2-01,2.01,2:16
2015-10-04 20:40:34 +08:00
回复了 Ansen 创建的主题 Python python 3 继承内置 list 对象问题
@zzbond0517
这是从 head first python 第 210 页 中原样抄出的代码,要错也是书里面写出了,但个人觉得这本书还是比较靠谱的(看样子每个程序貌似都经过调试的),或许是编书的时候忽略了某些前提,导致程序报错,碍于经验不足,找不出问题。
python IDLE 好像没有行号
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1223 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 11ms · UTC 18:17 · PVG 02:17 · LAX 11:17 · JFK 14:17
Developed with CodeLauncher
♥ Do have faith in what you're doing.