wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

The End

Total questions: 25

Worksheet time: 3mins

Name
Class
Date
1.

If we want to print each emoji in this list, what should we print?

emojis = [''😋" , "🦊" , "🌷" , "🏈"]

for emoji in emojis:

print(????)

a)

print(emojis)

b)

print(emoji)

c)

print(????)

2.

If we want to use pi in our program, what should we import?

a)

import numpy

b)

import pi

c)

import Math

d)

none of them

3.

What is the output of this code?

float(True)

(a)  

4.

What is the output of this code?

int(False)

(a)  

5.

What does this code do?

fruits = ['apple', 'banana', 'orange']

fruits.insert(2, 'cherry')

a)

['apple', 'banana', 'cherry', 'orange']

b)

['apple', 'cherry', 'orange']

c)

['apple', 'cherry', 'banana','orange']

6.

What will this print?

word = "Python"

print(word[0])

print(word[-1])

a)

P

n

b)

p

n

c)

Pn

7.

What will this print?

print(False == False)

a)

True

b)

False

c)

Error

8.

What is the type of this variable?

variable = 'True'

(a)  

9.

What do we use to oblige the user to enter only

a positive number?

a)

print ("enter a POSITIVE number !!! ")

b)

if number<0:

number = int(input

("enter a POSITIVE number!!!"))

c)

while number<0:

number = int(input

("enter a POSITIVE number !!!"))

10.

What is the type of this variable?

variable = -5

(a)  

11.

What is the type of this variable?

variable = "-5"

(a)  

12.

What does this code do?

x = [10, 20, 30]

x.remove(20)

print("x")

a)

x

b)

[10 , 30]

c)

[ ]

13.

What does this code print?

nums = [1, 2, 2, 3, 1]

print(set(nums))

a)

{1, 2, 3}

b)

[1, 2, 3]

c)

{1, 2, 2, 3, 1}

d)

[1, 2, 2, 3, 1]

14.

What does this code print?

basket = ["🤡", "🫨", "👽"]

print(basket[0])

a)

🤡

b)

🤡

c)

🤡

15.

What does this code print?

nums = [1, 2]

nums.append(3)

print(nums)

a)

[1, 2, 3]

b)

[3, 1, 2]

c)

none of them

16.

What will be the output of the following code?

a = [1, 2, 3]

b = [ ]

b.append(4)

print(a)

print(b)

a)

[1, 2, 3, 4]

b)

[4]

[1, 2, 3]

c)

[1, 2, 3]

[4]

d)

[1, 2, 3]

4

17.

What does this code print?

colors = ["red", "green", "blue"]

print("green" in colors)

a)

green

b)

True

c)

error

18.

What is the key word that we use to display something on screen?

(a)  

19.

What is the key word that we use to get something from the user?

(a)  

20.

What will be printed?

person = {"name": "Alice", "age": 25}

print(person["name"])

(a)  

21.

🎂 Sharing Cake

How many pieces per friend?

cake = 8

friends = 4

print(cake // friends)

a)

1

b)

2

c)

4

d)

8

22.

What will this code print?

cookies = ["choco", "choco", "vanilla"]

print(cookies)

a)

choco

choco

vanilla

b)

["choco", "choco", "vanilla"]

c)

cookies

d)

all of them

23.

🐶 Counting Puppies

puppies = ["dog", "dog", "dog"]

print(len(puppies))

a)

🐶

b)

🐶🐶

c)

🐶🐶🐶

d)

3

24.

What will this code print?

txt1 = "Hello"

txt2 = "Guys"

print("Hello" + " " + "Guys")

a)

HelloGuys

b)

hello guys

c)

helloguys

d)

Hello Guys

25.

What will this code print?

print("The End")

(a)