1/12
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
x = 5
Assigns the value 5 to variable x
x, y = 1, 2
Assigns 1 to x and 2 to y using tuple unpacking
a, b = b, a
Swaps the values of a and b
if condition:
Starts a conditional block
elif condition:
Adds another conditional branch
else:
Runs when no previous condition was true
for i in range(n):
Iterates i from 0 to n - 1
while condition:
Repeats while condition is true
break
Immediately exits the nearest loop
continue
Skips the rest of the current loop iteration
def f(x):
Defines a function with parameter x
return value
Exits a function and sends back value
lambda x: x + 1
Creates an anonymous function