Python
/
Functions
- 1 Language 9
-
Hello World
-
Variables
-
Functions
-
Conditional
-
Operators
-
While
-
Turtle
-
Script Mode
-
Debugging
- 2 Strings 6
-
Slice
-
Raw Strings
-
Regex
-
Validation
-
Config
-
Escape
- 3 Collections 5
-
Lists
-
Dictionaries
-
Efficiency
-
Tuples
-
References
- 4 Functions 5
-
Recursion
-
Factorial
-
Modulus
-
Reassignment
-
Approximate
- 5 Storage 8
-
Files
-
Databases
-
Pipes
-
With open
-
Shelve
-
Zip
-
Csv
-
Json
- 6 Class 4
-
Definition
-
Attributes
-
Functional
-
Methods
- 7 Goodies 5
-
Conditional Expression
-
List Comprehension
-
Generator
-
Named Tuple
-
Modules
- 8 Applications 5
-
Pythagora
-
Palindrome
-
Binary Search
-
Conway Game
-
Coin Flip
- 9 Scheduler 4
-
Time
-
Multithreading
-
Subprocess
-
Logging
- 10 Packages 2
-
Clipboard
-
Ocr
/
Reassignment
➟
➟
Last update: 19-11-2021
Assign
A variable must be assigned before use.
# Variable assignement ...
#
# A variable must be assign before use
y = 0
y = y + 1
assert y == 1
# z = z + 1
# # NameError: name 'z' is not defined
Reassignment
p 120 In Python it is legal to reassign a variable.
# In Python it is legal to reassign a variable.
# An assignment can make two variables equal, but not permanent.
x = 5
x = 7
assert x == 7
assert x != 5
a = 1
b = 1
assert a == b
a = 2
assert a != b
➥ Questions github Functions