Python打印问题
出于某种原因,它告诉我:Python打印问题,python,Python,出于某种原因,它告诉我: print "I will now count my slaves:" print "females", 50 + 80 \ 10 print "males", 10 \ 2 print "Is it true that 6 > 7?" print "What is 59 + 27?" \字符是行连续字符,而不是除法运算符。它通常用于告诉Python将行连接在一起: print "females", 50 + 80 \ 10
print "I will now count my slaves:"
print "females", 50 + 80 \ 10
print "males", 10 \ 2
print "Is it true that 6 > 7?"
print "What is 59 + 27?"
\字符是行连续字符,而不是除法运算符。它通常用于告诉Python将行连接在一起:
print "females", 50 + 80 \ 10
^
SyntaxError: unexpected character after line continuation character
使用/用于分区:
foo = "This is a long line that won't fit inside 80 characters " \
"so the line continuation character is one way to extend " \
"the logical line across multiple physical lines."
\字符是行连续字符,而不是除法运算符。它通常用于告诉Python将行连接在一起:
print "females", 50 + 80 \ 10
^
SyntaxError: unexpected character after line continuation character
使用/用于分区:
foo = "This is a long line that won't fit inside 80 characters " \
"so the line continuation character is one way to extend " \
"the logical line across multiple physical lines."