Line StructurePython statements are delimited by newlinesprint a+3 b = 4*x Line continuation (\) can be used for long statementsa = math.cos(3*(x-n)) + \ math.sin(3*(y-n)) Triple-quoted strings, lists, tuples, and dictionaries can span multiple linesa = [ 4, 5 ] b = { 'x': 10, 'y': 20 } c = foo(x,y,z, w,v) Short statements can be separated by a semicolon (;)a = 3; b = 10*x; print b |
<<< | O'Reilly OSCON 2000, Introduction to Python, Slide 26 July 17, 2000, beazley@cs.uchicago.edu |
>>> |