***Welcome to ashrafedu.blogspot.com * * * This website is maintained by ASHRAF***

Tuesday, April 27, 2021

Multi-Line Statements

Statements in Python
typically end with a new line. Python does, however, allow the use of the line
continuation character (\) to denote that the line should continue.



Example:



total_item    = item_one
+ \



                         item_two + \



                         item_three



Statements contained
within the [], {}, or () brackets do not need to use the line continuation
character.



Example:



days = ['Monday',
'Tuesday', 'Wednesday',



             'Thursday', 'Friday']

No comments:

Post a Comment