Operators
Conditional Statements
Break & Continue
Slicing
Bitwise Operators
100

What is the addition operator?

+ (Plus Sign)

100

An if statement does this:

Executes code if a condition is met; every if statement used is tested separately

100

What are the loops in Python?

While: executes (a) statement(s) if boolean condition is True

For: executes a set of statements many times

100

What does a slice do?

Makes a new copy of a list or a part of a list

100

What are bitwise operators? How many are there?

4 operators that allow you to manipulate single bits of data

200

What is the % (percent) operator for?

Remainder

200

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

200

True or False: The break and continue statements change the flow of a loop

True

200

What are negative indices?

Negative indices take the last index of a list as -1. In other words, it counts backwards.

200

What does the & (ampersand) operator do?

Returns 1 if both bits on the left and right are 1; else returns 0

300

What is the operator for floor/integer division?

// (Double Slash)
300

What happens if every if/elif statement is false?

The else statement is executed

300

What is the break statement for?

To exit a loop

300

Do you need a start and end parameter?

No, they're optional: [1: ], [ :-2]

300

What does the | (bar) operator do?

Returns 1 if either bit is 1, else returns 0

400

Exponentiation has what type of binding?

Right-sided

400

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)

400

What is the continue statement for?

Skips the current iteration and continues with the next one

400

How do you delete slices in Python?

the del instruction

400

What does the ~ (tilde) operator do?

Flips all the bits; 1s become 0s and vice versa

500

Unary operators have this many operands, binary operators have this many

Unary: 1

Binary: 2

500

What is a nested conditional statement?

A conditional statement inside another conditional statement

500

How does the break statement affect an else clause?

A break statement terminates an else clause

500

What does deleting slices do?

Deletes parts of a list or the entire list

500

What does the ^ (caret) operator do?

Returns 1 if bits are different, returns 0 if bits are the same