Variables ============================== Examples in Python 3 ```python """ Create some variables """ x = 42 print(x) y = 4.2 print(y) text = "Hello world!" print(text) a, b = 4, 2 print(a) print(b) ``` Illegal variable naming ------------------------------ ```python """ Following examples will lead to syntax errors as the variables names are illegal """ # Leading numbers 5ants = "More than 4 elephants" # Illegal characters @nt$ = 5 # Keywords from = "Sweden" ``` ### Reserved keywords The following words can not be used to name variables, as they are keywords: ``` False class finally is return None continue for lambda try True def from nonlocal while and del global not with as elif if or yield assert else import pass break except in raise ``` Reference and read more ------------------------------ [Assignment statements](https://docs.python.org/3/reference/simple_stmts.html#assignment-statements) [Identifiers and keywords](https://docs.python.org/3/reference/lexical_analysis.html#identifiers) Revision history ------------------------------ 2014-07-16 (sylvanas) PA1 First try.