Just started Intro to Python an have no previous knowledge about coding-That being said Professors rubric didn't explain anything any ideas [关闭] 。

问题描述 投票:-2回答:1
Traceback (most recent call last):
  File "challenges/str.py", line 7, in <module>
    result = 'a string combined with the number: ' + aString
TypeError: Can't convert 'int' object to str implicitly
python string traceback
1个回答
0
投票

由于缺少代码,没有解释,在我看来 aString 对象是一个整数。

为了解决这个问题,带有错误的一行应该变成。

result = 'a string combined with the number: ' + str(aString)

希望这能帮到你!

© www.soinside.com 2019 - 2024. All rights reserved.