[英]Why is my simple python program giving me errors
enter image description here在此处输入图像描述
It is giving me error idk why I want to also add string if possible in the place of int它给了我错误 idk 为什么我还想在可能的情况下添加字符串来代替 int
You can't add strings and numbers with ",", you have to use "+" or the new formatted strings (Since Python 3.6):您不能使用“,”添加字符串和数字,您必须使用“+”或新的格式化字符串(自 Python 3.6 起):
print(f"Here is your text. You can add variables with {variableName} or calculation like {a + b}")
Hope that helps.希望有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.