Font size
WorksheetsThe End
Total questions: 25
Worksheet time: 3mins
If we want to print each emoji in this list, what should we print?
emojis = [''😋" , "🦊" , "🌷" , "🏈"]
for emoji in emojis:
print(????)
print(emojis)
print(emoji)
print(????)
If we want to use pi in our program, what should we import?
import numpy
import pi
import Math
none of them
What is the output of this code?
float(True)
(a)
What is the output of this code?
int(False)
(a)
What does this code do?
fruits = ['apple', 'banana', 'orange']
fruits.insert(2, 'cherry')
['apple', 'banana', 'cherry', 'orange']
['apple', 'cherry', 'orange']
['apple', 'cherry', 'banana','orange']
What will this print?
word = "Python"
print(word[0])
print(word[-1])
P
n
p
n
Pn
What will this print?
print(False == False)
True
False
Error
What is the type of this variable?
variable = 'True'
(a)
What do we use to oblige the user to enter only
a positive number?
print ("enter a POSITIVE number !!! ")
if number<0:
number = int(input
("enter a POSITIVE number!!!"))
while number<0:
number = int(input
("enter a POSITIVE number !!!"))
What is the type of this variable?
variable = -5
(a)
What is the type of this variable?
variable = "-5"
(a)
What does this code do?
x = [10, 20, 30]
x.remove(20)
print("x")
x
[10 , 30]
[ ]
What does this code print?
nums = [1, 2, 2, 3, 1]
print(set(nums))
{1, 2, 3}
[1, 2, 3]
{1, 2, 2, 3, 1}
[1, 2, 2, 3, 1]
What does this code print?
basket = ["🤡", "🫨", "👽"]
print(basket[0])
🤡
🤡
🤡
What does this code print?
nums = [1, 2]
nums.append(3)
print(nums)
[1, 2, 3]
[3, 1, 2]
none of them
What will be the output of the following code?
a = [1, 2, 3]
b = [ ]
b.append(4)
print(a)
print(b)
[1, 2, 3, 4]
[4]
[1, 2, 3]
[1, 2, 3]
[4]
[1, 2, 3]
4
What does this code print?
colors = ["red", "green", "blue"]
print("green" in colors)
green
True
error
What is the key word that we use to display something on screen?
(a)
What is the key word that we use to get something from the user?
(a)
What will be printed?
person = {"name": "Alice", "age": 25}
print(person["name"])
(a)
🎂 Sharing Cake
How many pieces per friend?
cake = 8
friends = 4
print(cake // friends)
1
2
4
8
What will this code print?
cookies = ["choco", "choco", "vanilla"]
print(cookies)
choco
choco
vanilla
["choco", "choco", "vanilla"]
cookies
all of them
🐶 Counting Puppies
puppies = ["dog", "dog", "dog"]
print(len(puppies))
🐶
🐶🐶
🐶🐶🐶
3
What will this code print?
txt1 = "Hello"
txt2 = "Guys"
print("Hello" + " " + "Guys")
HelloGuys
hello guys
helloguys
Hello Guys
What will this code print?
print("The End")
(a)
