top of page

Multi-­‐Line Statements in Python

  • Writer: Jino Shaji
    Jino Shaji
  • Jan 17, 2015
  • 1 min read

Updated: Jun 9, 2020


   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.

     For example: total = item_one + \           item_two + \                    item_three 

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



  days = [‘Monday’, ‘Tuesday’, ‘Wednesday’, ‘Thursday’, ‘Friday’] 
 

Recent Posts

See All
Program to Create an investment report.

“””Program: investment.py Author: JINO SHAJI Compute an investment report. 1. The inputs are        starting investment amount       ...

 
 
 

Commenti


bottom of page