Which statement is used to produce multi line
output
Answers
Answer:
Parentheses ( ), brackets [ ],braces { },‘\’ sign statement is used to produce multi line.
Explanation:
In Python, a statement is a logical command that a Python interpreter can read and carry out. It might be an assignment statement or an expression in Python.
Multi-line Statement in Python:
In Python, the statements are usually written in a single line and the last character of these lines is newline. To extend the statement to one or more lines we can use braces {}, parentheses (), square [], semi-colon “;”, and continuation character slash “\”. we can use any of these according to our requirement in the code. With the line continuation character, we can explicitly divide a long statement into numerous lines (\).
In Python, the preferred way of wrapping long expression over multiple lines is to put it inside parentheses
Example
a=(10**2+
10*5
-10)
print (a)
Output
This will result in 140.
Example
Another way is to use line continuation character
b=1+ \
2 + \
3
print (b)
Note that even if items in List, Tuple or Dictionary object span over multiple lines, the line continuation character is not needed.
Reference Link
- https://brainly.in/question/6130603