like assignmentsprintsand function calls compound statements like if tests and while loops must still appear on lines of their own (otherwiseyou could squeeze an entire program onto one linewhich probably would not make you very popular among your coworkers!the other special rule for statements is essentially the inverseyou can make single statement span across multiple lines to make this workyou simply have to enclose part of your statement in bracketed pair--parentheses (())square brackets ([])or curly braces ({}any code enclosed in these constructs can cross multiple linesyour statement doesn' end until python reaches the line containing the closing part of the pair for instanceto continue list literalmylist [ because the code is enclosed in square brackets pairpython simply drops down to the next line until it encounters the closing bracket the curly braces surrounding dictionaries (as well as set literals and dictionary and set comprehensions in and allow them to span lines this way tooand parentheses handle tuplesfunction callsand expressions the indentation of the continuation lines does not matterthough common sense dictates that the lines should be aligned somehow for readability parentheses are the catchall device--because any expression can be wrapped in themsimply inserting left parenthesis allows you to drop down to the next line and continue your statementx ( dthis technique works with compound statementstooby the way anywhere you need to code large expressionsimply wrap it in parentheses to continue it on the next lineif ( = and = and = )print('spam an older rule also allows for continuation lines when the prior line ends in backslashx an error-prone older alternative this alternative technique is datedthoughand is frowned on today because it' difficult to notice and maintain the backslashes it' also fairly brittle and error-prone-there can be no spaces after the backslashand accidentally omitting it can have unexpected effects if the next line is mistaken to be new statement (in this example" dis valid statement by itself if it' not indentedthis rule is also another throwback to the languagewhere it is commonly used in "#definemacrosagainwhen in pythonlanddo as pythonistas donot as programmers do introducing python statements