What does print do?
Displays whatever is entered into the terminal
What is the = sign called?
Assignment operator
What characters symbolize the creation of a list?
[]
How many elifs can exist at the same time?
as many as you want
exponents
What does range(n) give you?
A list containing all the numbers from 0 to n-1
What is the data type for the following values?
"Hello", 100.0, 1000, "1000"
String, float, int, String
How do you access a certain element at a position in a list?
list_name[index_number]
What are the components of a for loop?
loop control variable and an iterable value
What is the difference between in and is?
in checks membership, is checks if the two value types are the same.
Does print have effects on the code?
No
Which function do we use to get the variable type of a variable?
type()
How do you add an element to the end of a list?
list.append(value)
What determines the number of times a for loop will run?
Length of the iterable value
What is the difference between or and and?
and requires both boolean expressions to be true, while or requires only one to be true.
What are the compound (or iterable) variable types we know right now?
Strings and Lists.
list1 = [0, 1, 1, 2, 3, 5, 8, 13]
list1.remove(2)
del list1[0]
list1.appen(4)
list1.sort()
what is the result?
[1, 1, 3, 4, 5, 8, 13]
i.e. if _____, what do you put there?
A boolean expression
What does ord() and chr() do respectively?
ord() converts a character to the ascii number, chr() converts the ascii number to the character.
What is the value type of the value given by input()?
String
Can lists contain multiple data types. So, is the following list [1, "Hello", True, 0.0] valid?
Yes
What is the difference between
list.remove() and del list[number]
remove removes the first element with a value, del removes the element at a certain position.
How does a for loop work?
The loop control variable will take on each specific value of the iterable value in order each time the loop runs.
x = 1
y = 2
z = 3
bool = ((x == y or z == y) or (x == 1 and z == 2)) and (True)
What is the result?