NEW
Font size
Worksheets001
Total questions: 20
Worksheet time: 3mins
What does this code print?
print("Hello" + "World")
Hello World
HelloWorld
"Hello" + "World"
What will type(5.0) return?
int
float
str
bool
What is the result of this code?
print(3 * "ha")
hahaha
3ha
Error
What does input() do in Python?
It displays something on the screen.
It calculates numbers.
It receives user input.
Which of these is a valid variable name?
2cool
my-name
first_name
What is the result of this code?
4 + 3 * 2
14
10
7
11
What is the data type of "42"
int
str
bool
float
Which operator checks if two values are equal?
=
==
!=
What does this code do?
10*2 == True
True
20
Flase
What will this print?
print(10 > 5)
True
10
False
What does len(["a", "b", "c"]) return?
0
3
a b c
abc
What keyword is used to define a function in Python?
function
def
DEF
Which of these is a list?
{1, 2, 3}
[1, 2, 3]
(1, 2, 3)
"1, 2, 3"
How can you display “3.14” using the math module?
math.pi
math.3,14
math.value
What will this print?
mylist = ["🥑" , "🍌" , "🍉" , "🥥"]
print(mylist [1] )
🥑
🍌
1
List, Set, and Dictionary: mutable
Tuple: Immutable
Yes
No
What does this code print?
fruits = {"apple", "banana", "apple", "orange"}
print(fruits)
['apple', 'banana', 'apple', 'orange']
{'apple', 'banana', 'orange'}
apple banana apple orange
Which of these is a dictionary?
{"name": "Sara", "age": 15}
["name", "Sara", "age", 15]
("name", "Sara")
How do you access the second element in a list called items?
items.2
items[2]
items(2)
items[1]
Which data structure is best for storing a group of unique values?
List
Dictionary
Set
Tuple
