3.1. Statements and Syntax

Some rules and certain symbols are used with regard to statements in Python:

  • Hash mark ( # ) indicates Python comments

  • NEWLINE ( \n ) is the standard line separator (one statement per line)

  • Backslash ( \ ) continues a line

  • Semicolon ( ; ) joins two statements on a line

  • Colon ( : ) separates a header line from its suite

  • Statements (code blocks) grouped as suites

  • Suites delimited via indentation

  • Python files organized as “modules”

3.1.1. Comments ( # )

First thing's first: Although Python is one of the easiest languages to read, it does not preclude the programmer from proper and adequate usage and placement of comments in the code. Like many of its Unix scripting brethren, Python comment statements begin with the pound sign ...

Get Core Python Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.