Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 7. Control Flow Statements > Putting Multiple Statements on a Line

Putting Multiple Statements on a Line

It's good programming style to give each statement its own line, but Python lets you put more than one statement on a line if you separate statements with a semicolon (Figure 7.10). You also can move the body of a compound statement to the header line (Figure 7.11).

Figure 7.10. You can place multiple statements on a line if you separate the statements with a semicolon.



  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint