异常: EOL while scanning string literal

Today wrote a code:

  

>>>print("Name:%s" % ('Phil') , "Age:%d" % (13) , sep=r"\\\")
 File "<stdin>", line 1
     print("Name:%s" % ('Phil'),"Age:%d" % (13),sep=r"\\\")
                                                         ^
 SyntaxError: EOL while scanning string literal

This exception is thrown.

Plus without r no difference, online search, the original EOL the while Scanning String literal this anomaly is due to the quote does not appear in pairs caused, and now want regardless of plus without the final r has a lone '\'

The solitary '\' just affect me "Age:% d" in front of the double quotes.

Finally, the number of \ into an even number just fine. . . .

 

Come on. . I really brother

Guess you like

Origin www.cnblogs.com/Python-Phil/p/11366232.html