Syntactical Structure

 

Python

Java

 

Lexical items on a single line are separated by zero or more spaces.

 

Indentation is significant and is used to mark syntactical structures, such as statement blocks and code within function, class, and method definitions.

 

A phrase can be broken and continued on the next line after a comma, or by using the '\' symbol.

 

The headers of control statements and function, class, and method definitions end with a colon (:).

 

 

Indentation is not significant, so all lexical items are separated by zero or more spaces.

 

Blocks of code in statements and definitions are enclosed in curly braces ({}).

 

Simple statements end with a semicolon (;).

 

Boolean expressions in loops and if statements are enclosed in parentheses.  

 

 

Previous

Index

Next