你不能将链接
string到
int。你需要使用函数将转换int为,或使用格式化输出。
stringstrformatting
变更:
print("Ok. Your balance is now at " + balanceAfterStrength + " skill points.")
至:
print("Ok. Your balance is now at {} skill points.".format(balanceAfterStrength))
要么:
print("Ok. Your balance is now at " + str(balanceAfterStrength) + " skill points.")
或根据注释,用于,将不同的字符串传递给print函数,而不是使用+:- 串联
print("Ok. Your balance is now at ", balanceAfterStrength, " skill points.")
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)