What is the name of the loop that iterates over a sequence, such as a list or string, in Python?
'For' loop
What data type is used to represent a decimal number in Python?
Floats
What symbol is used to assign a value to a variable in Python?
=
What is this operator called: %?
Modulo
In a while loop, what happens if the loop condition is always true?
An infinite loop
Which data type is used to store multiple values in a single variable and is ordered and changeable?
List
What is the correct way to declare a variable named age and assign it the value 12?
age = 12
What is this way of writing a variable name:
iLoveDogs
Camel Casing
for i in range(1, 5):
print(i * 2)
2,4,6,8
is_valid = False
print(type(is_valid))
bool ( boolean )
Which of the following is the most correct way to write a variable name in Python?
3. first_name
Tell me the process of how code runs?
Code written in environment, compiler, RAM, binary, CPU
In a for loop, which function is commonly used to generate a sequence of numbers?
What data type would you use to create an immutable ( unchangeable ) sequence of items?
Tuple
name = "Charlie"
print("Hello, " + name)
Hello, Charlie
What is this number when converted from binary ro regular:
1011
11
count = 0
while count < 3:
print(count)
count += 1
else:
print("Done!")
0, 1, 2, "Done!"
mixed = [42, "banana", 7.5, False] print(type(mixed[2]))
Float
What will be the output of the following code snippet?
x = 10
y = x
x += 5
print(y)
10
not True and False or ( not True ) and False or True and False
( must show your work )
False