What is the addition operator?
+ (Plus Sign)
An if statement does this:
Executes code if a condition is met; every if statement used is tested separately
What are the loops in Python?
While: executes (a) statement(s) if boolean condition is True
For: executes a set of statements many times
What does a slice do?
Makes a new copy of a list or a part of a list
What are bitwise operators? How many are there?
4 operators that allow you to manipulate single bits of data
What is the % (percent) operator for?
Remainder
An if-else statement does this:
Executes code if a condition is met (if), otherwise executes something different (else); every if and else statement used is tested separately
True or False: The break and continue statements change the flow of a loop
True
What are negative indices?
Negative indices take the last index of a list as -1. In other words, it counts backwards.
What does the & (ampersand) operator do?
Returns 1 if both bits on the left and right are 1; else returns 0
What is the operator for floor/integer division?
What happens if every if/elif statement is false?
The else statement is executed
What is the break statement for?
To exit a loop
Do you need a start and end parameter?
No, they're optional: [1: ], [ :-2]
What does the | (bar) operator do?
Returns 1 if either bit is 1, else returns 0
Exponentiation has what type of binding?
Right-sided
What does the elif statement do?
If an if statement tested is false, the following elif statements will then be tested until true. (Basically, it's another if statement, but not tested separately)
What is the continue statement for?
Skips the current iteration and continues with the next one
How do you delete slices in Python?
the del instruction
What does the ~ (tilde) operator do?
Flips all the bits; 1s become 0s and vice versa
Unary operators have this many operands, binary operators have this many
Unary: 1
Binary: 2
What is a nested conditional statement?
A conditional statement inside another conditional statement
How does the break statement affect an else clause?
A break statement terminates an else clause
What does deleting slices do?
Deletes parts of a list or the entire list
What does the ^ (caret) operator do?
Returns 1 if bits are different, returns 0 if bits are the same