2 operators, 3 compound statements – Rainbow Electronics GM862-GPS User Manual
Page 15

Easy Script
in Python
80000ST10020a Rev.8 - 01/10/08
Reproduction forbidden without Telit Communications S.p.A. written authorization - All Rights Reserved
page 15 of 100
1.5.2 Operators
Python has the following operators:
• Arithmetic and bitwise operators
+ - * / % ** ~ << >> & ^ |
• Relational and logical operators
is in < <= > >= == != not and or
• Assignments
= += -= *= /= %= **= <<= >>= &= ^= |=
• Other operators
() [ ] { } [:] `` . lambda
1.5.3 Compound statements
• Statements that belong to the same logical group are indented by the same amount of white
space:
if a > 0:
b = 1
c = 2
Usually, each statement starts on a new line.
• A statement is continued by putting a backslash \ at the end of a line. This isn't necessary if
there are still parentheses (or brackets or braces) open:
my_list = [1, # open bracket, statement continues
['abc', 2], # nested list
-3+6j] # closed outermost bracket, statement ends
my_list