character_age = "13"
character_name = "lado"
print( + character_name + " really like coding")
print( " but she didnt learn to type until " + character_age + " years old. ")
当出现这些错误时,我正试图用python学习变量
PS D:\freecodecamp> & C:/Users/admin/AppData/Local/Programs/Python/Python39/python.exe d:/freecodecamp/2.py
Traceback (most recent call last):
File "d:\freecodecamp\2.py", line 6, in <module>
print(+_character_name+ " really like coding, ")
TypeError: bad operand type for unary +: 'str'
在第一个print语句中有一个额外的
+
。使用以下命令:print(character_name + " really like coding")
相关问题 更多 >
编程相关推荐