Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python 3

Total questions: 17

Worksheet time: 9mins

Name
Class
Date
1.

What will be the output of the following code?

a)

🌍🌎

b)

🌍

c)

🌍🌏

d)

No output

2.

What will be the printed output?

a)

No output

b)

🔔

c)

🔔🛎

d)

🛎

3.

What will be the result of the following code?

a)

🚀🚀🚀🚀

b)

✈️✈️🚀🚀

c)

✈️✈️✈️✈️

d)

✈️✈️🚀✈️

4.

Which of the following lines of code would make the statement “Hello World” repeat 10 times?

a)

print('Hello World' x 10)

b)

print('Hello World' * 10)

c)

print('Hello World' + 10)

5.

Which of the following lines of code would output the statement "Python programming is easy!"?

a)

print("Python is easy!")

b)

print("Programming in Python is easy!")

c)

print("Python programming is easy!")

6.

Which of the following code snippets correctly stores the phrase "Hello World" in a variable called a and then prints it?

a)

b)

c)

7.

Which of the following code snippets correctly stores the integer 256 in a variable called points and then prints it?

a)

b)

c)

8.

To print "Hello Rob-bot, you are 10 years old" using variables, which is right?

a)

name = "Rob-bot"; age = "10"

b)

name = Rob-bot; age = 10

c)

name = "Rob-bot"; age = 10

9.

Which code snippet correctly asks for the user's name details and prints the message?

a)

Uses input thrice and prints "Hello" with first and last.

b)

Uses firstName and lastName without spaces in the print.

c)

Prints "Hello" with first, and, and last.

d)

Prints using name + last.

10.

What will the output of the following code be?

print(3 + 5)

a)

8

b)

35

c)

3 + 5

d)

Error

11.

How do you create a single-line comment in Python?

a)

/* This is a comment */

b)

-- This is a comment

c)

# This is a comment

12.

Which of the following is the correct way to define a string variable in Python?

a)

x = string('Hello')

b)

x = Hello

c)

x = 'Hello'

13.

What does the following code output?

a)

Hello, Alice!

b)

Hello, name!

c)

Hello, "Alice"!

d)

Error

14.

Which is NOT a valid data type in Python?

a)

str

b)

int

c)

float

d)

num

15.

What will be the output of the following code?

print("🍕" * 2 + "🍔")

a)

🍔🍔🍕

b)

🍕🍕🍔

c)

🍕🍔🍔

16.

Given the variable count = 3, how can you print "I have 3 🍎."?

a)

print("I have " + count + " 🍎.")

b)

print(f"I have {count} 🍎.")

c)

print("I have ", count, " 🍎.")

17.

How are you feeling today?

a)

I'm feeling great 😃

b)

I'm good 🙂

c)

I'm doing fine but could be better 😕

d)

I'm struggling 😔

e)

I don't know 😐