Font size
Worksheets2.00
Total questions: 20
Worksheet time: 3mins
print(type([1, 2, 3]))
int
Error
list
What keyword starts a loop that repeats a known number of times?
while
loop
for
What is the index of "🐥" in this list?
["🐢" , "🐥", "🦩"]
0
1
2
What does this code print?
print(5/0)
0
5
5/0
Error
What will this do?
fruit = ["🍎" , "🍌"]
fruit[1] = "🍉"
print(fruit)
["🍎", "🍉"]
["🍎", "🍌", "🍉"]
🍉🍎
What is not True in Python?
False
0
What will this print?
text= "Hello Python"
print(text[2])
e
l
Python
Hello Python
Hello Python
What will we get as a result here?
print(False == False and 5>2)
False
True
What will this code print?
text = "Hello Go My Code"
print(text.count('o'))
o
3
16
What will this code print?
Print("Hello World")
Hello World
Error
What’s the correct way to write a comment in Python?
<!-- comment -->
// comment
# comment
** comment
What’s the correct way to get all keys from this dictionary?
my_dict = {"a": 1 , "b": 2}
my_dict.keys()
keys(my_dict)
print("a" + "b")
What does this output?
drinks = ["🥤", "🍵","🍼"]
print(len(drinks))
2
["🥤", "🍵","🍼"]
3
Which of these creates a tuple?
[1, 2]
{1, 2}
(1, 2)
What will this code print?
print("Hello world 🚀")
Hello world 🚀
Hello World 🚀
Error
Hello world
What is the first key in this dict?
(a)
What is the value of the second key in this dict?
(a)
What happens here?
x = 5
x += 2
print(x)
5
52
7
What is the name of this data structure?
data = {1, 2, 2, 23, 8, 2}
(a)
So, what is the output of this?
data = {1, 2, 2, 23, 8, 2}
{1, 2, 2, 23, 8, 2}
{1, 2, 23, 8}
{8, 1, 2, 23}
