Font size
Worksheets3.00
Total questions: 20
Worksheet time: 3mins
What will this code do?
print(7 // 2)
3.5
3
4
What is printed?
print("Hi" + "5")
Hi5
Hi+5
5Hi
What is printed?
print("Hi+5")
Hi5
Hi+5
5Hi
What will happen here?
print("Level " + str(5))
Error
Level + 5
Level 5
What is the length of this list?
["🍕", "🍔", "🍟", "🌮"]
3
4
5
What is the index of the last element in this list?
["🍕", "🍔", "🍟", "🌮"]
3
4
5
What is printed?
print(type(3.14))
(a)
What is printed?
print(type("3.14"))
(a)
What data structure uses keys and values?
List
Tuple
Dictionary
Set
Which data structure is immutable?
(immutable = unchangeable)
(a)
What type is this?
True
str
bool
int
none of them
What is the output here?
int(True)
True
1
Error
What does .append() do to a list?
Deletes the last item
Adds an item in the end
Adds an item in a specific index
What does math.sqrt(9) return?
3
81
9
Choose the correct syntax for a dictionary
["apple": "red"]
{"apple": "red"}
("apple", "red")
{"apple", "red"}
What does this print?
print(3 in [1,4,5,8,6,2,3,7,5,9,6,8,4])
True
False
3
[3]
What is the output here?
for number in range(5):
print(number)
(a)
What is the output here?
numbers = [1, 2, 3, 4, 5]
for number in numbers:
print(numbers)
[1, 2, 3, 4, 5]
[1, 2, 3, 4, 5]
[1, 2, 3, 4, 5]
[1, 2, 3, 4, 5]
[1, 2, 3, 4, 5]
1
2
3
4
5
What does this print?
print("🐱" * 3)
🐱🐱🐱
🐱3
"🐱" * 3
What does this code do?
fruits = ['apple', 'banana', 'orange', 'apple']
fruits.remove('apple')
print(fruits)
['banana', 'orange', 'apple']
['banana', 'orange']
