![](/img/trans.png)
[英]How to put the contents of a (string) variable inside a string using a function - Python
[英]How to put string inside string (variable) in Python?
我尝试运行一些 python 代码,但它显示“[pyflakes] 解析时意外 EOF”
我的代码是:
if "debug " in code:
print(" |" + x + "|" + y + "| ")
编辑:也不要说重复我尝试了另一个问题的答案,但没有奏效。 我使用 Python 3.8.2
尝试使用 f 字符串。
if "debug " in code:
print(f" | {x} | {y} | ")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.