Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 2.7 Python中while循环中的语法错误_Python 2.7 - Fatal编程技术网

Python 2.7 Python中while循环中的语法错误

Python 2.7 Python中while循环中的语法错误,python-2.7,Python 2.7,请告诉我下面的编码有什么问题?它给出了以下错误 语法错误:行连续字符后出现意外字符 while True: for i in ["\","-","|","\\","|"]: print "%s\r" % i, 您需要转义第一个\: while True: for i in ["\\","-","|","\\","|"]: # Here -^ print "%s\r" % i, 您需要转义第一个\: while True:

请告诉我下面的编码有什么问题?它给出了以下错误

语法错误:行连续字符后出现意外字符

while True:
    for i in ["\","-","|","\\","|"]:
        print "%s\r" % i,

您需要转义第一个
\

while True:
    for i in ["\\","-","|","\\","|"]:
        # Here -^
        print "%s\r" % i,

您需要转义第一个
\

while True:
    for i in ["\\","-","|","\\","|"]:
        # Here -^
        print "%s\r" % i,

您没有跳过反斜杠,并且打印行末尾有一个逗号:

while True:
  for i in ["\\","-","|","\\","|"]:
    print "%s\r" % i

您没有跳过反斜杠,并且打印行末尾有一个逗号:

while True:
  for i in ["\\","-","|","\\","|"]:
    print "%s\r" % i

哦非常感谢你!如果为真:对于i in[“/”、“-”、“\\”、“\\”、“\\”]:打印“%s\r”%i,当您键入“/”而不键入“\”时,程序将继续运行如何停止它?哦!非常感谢你!如果为True:对于i in[“/”、“-”、“\\”、“\\”、“\\”]:打印“%s\r”%i,当您键入“/”而不键入“\”时,程序将继续运行,如何停止它?