Python里的特殊符号还有许多,今天带大家了解一下其他的符号。
【1】换行继续符(\)
继续符是一个能让代码简洁符号,也就是说一行过多的语句可以被反斜杠分为几段。
代码举例:
# check conditions
def send_goto_beach_mesg_to_pager():
pass
if (weather_is_hot == 2) and \
(shark_warnings == 1):
Python里的特殊符号还有许多,今天带大家了解一下其他的符号。
【1】换行继续符(\)
继续符是一个能让代码简洁符号,也就是说一行过多的语句可以被反斜杠分为几段。
代码举例:
# check conditions
def send_goto_beach_mesg_to_pager():
pass
if (weather_is_hot == 2) and \
(shark_warnings == 1):