Multi-Line Statements
In Python, statements are nothing but instructions given to a Python interpreter to u
and carry out. These statements are usually written in a single line of code. But, tha
mean Python does not have a provision to write these statements in multiple lines.
There are two types of statements in Python. They are assignment statements and
statements. Both of them can be broken into multiple lines of statements a
interpreter will have no problem understanding them.
,
,
, Using Brackets
If you do not want to use the line continuation character, multiple li
of a single statement can be grouped together using brackets. Th
brackets can be parenthesis (), curly brackets {}, or square bracket
This is known as implicit line continuation and python interpreter
understand them all.
In Python, statements are nothing but instructions given to a Python interpreter to u
and carry out. These statements are usually written in a single line of code. But, tha
mean Python does not have a provision to write these statements in multiple lines.
There are two types of statements in Python. They are assignment statements and
statements. Both of them can be broken into multiple lines of statements a
interpreter will have no problem understanding them.
,
,
, Using Brackets
If you do not want to use the line continuation character, multiple li
of a single statement can be grouped together using brackets. Th
brackets can be parenthesis (), curly brackets {}, or square bracket
This is known as implicit line continuation and python interpreter
understand them all.