What are Python Operators?
Operators are used to perform operations on variables and values.
What are the four containers?
List, set, tuple, and dictionary
What is the definition of "condition"?
Definition: An expression that evaluates to boolean value
When are while loops useful?
They are useful when the no. of iterations is unknown before the loop starts
What is the two most used containers?
Lists and dictionaries
How many Arithmetic Operators are there? Name them!
There are 7 arithmetic operators: Addition, Subtraction, Multiplication, Division, Modulus, Exponentiation, and Floor Division
What is the code to insert "X" in the middle of list L?
L.insert(len(L)//2, "X")
or
L.insert(len(L)/2, "X")
What is the definition of conditional?
Definition: An expression that evaluates to boolean value
When is the while loop condition checked?
The loop condition is checked before each iteration
Name all the immutable containers
Tuple
What is the symbol for "less than"?
<
What is the description of the list method "extend()"?
Add the elements of a list (or any iterable), to the end of the current list
How may if statements can you have in your code?
Infinite
for loops iterate over a [BLANK]
sequence
What is the result of addition?
Sum
What is the description of "is not"?
Returns True if both variables are not the same object
What are the ONLY built-in methods that you can use on tuples?
The two methods are: count() and index()
Is the "if" statement dependent on the "else" (True/False)
False
What method should we use to immediately iterate through a dictionaries keys?
.keys()
Name the 3 types of division in python?
Floor division, modulus, and regular division
What are the 7 groups of Python Operators?
Arithmetic, Assignment, Comparison, Logical, Identity, Membership & Bitwise Operators
What are the method names to perform set operations?
Union, difference, intersection and symmetric difference
What is elif short for?
Short for "else if"
What is Nesting?
Nesting refers to the practice of placing one construct inside another construct of the same kind.
Write the code to get the number 4 from the list L=[1,2,3,4,6,8]
four = L[3] # four = L[-3]