CSCA08H3 Study Guide - Midterm Guide: Substring, Operand, List Comprehension
Document Summary
The python keywords: and def finally in pass yield as del for is raise. True assert break class continue else except exec if not while inport or with elif from global lambda nonlocal return. A variable is a name that refers to a value. Note: don t name a variable with python keywords. An assignment statement in a function creates a local variable, or a temporary variable which only exists inside the function and you cannot use it outside. def square(x): y = x * x return y. The variable y is a local variable and it only exists while the function square is being executed we call this its lifetime. When the execution of the function terminates (returns), the local variables are destroyed. Formal parameters are also local and act like local variables. All the variables that are defined as local variables. An expression is a combination of values, variables, operators, and calls to functions.