简体   繁体   English

如何显示带有有理表达式的字符串,例如 '\'

[英]How can I display a string with its rational expressions, such as '\'

I want to display a rational expression using Python 3. Because it is stored in my variable, it applies the effect of the backslash on my terminal, here is the rational expression I try to display:我想使用 Python 显示有理表达式 3. 因为它存储在我的变量中,所以它在我的终端上应用了反斜杠的效果,这是我尝试显示的有理表达式:

struct = "{}\"{}\"{}{}{}"

So what I am trying to find is an expression that prints all the string, including the '\'所以我要找的是一个打印所有字符串的表达式,包括'\'

You can solve it like this:你可以这样解决:

struct = '{}\\"{}\\"{}{}{}'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM