【发布时间】:2014-11-08 03:12:34
【问题描述】:
我正在使用最新的 Python 3
letters = ['a', 'b', 'c', 'd', 'e']
letters[:3]
print((letters)[:3])
letters[3:]
print((letters)[3:])
print("Here is the whole thing :" + letters)
错误:
Traceback (most recent call last):
File "C:/Users/Computer/Desktop/Testing.py", line 6, in <module>
print("Here is the whole thing :" + letters)
TypeError: Can't convert 'list' object to str implicitly
修复时,请解释它是如何工作的 :) 我不想只是复制固定的行
【问题讨论】:
-
我和你的 Python 解释器一样困惑:你想要什么输出?
标签: python string python-3.x list typeerror