wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Grade 6- PRINT statement in Python

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What does the print() function do in Python?

a)

Adds two numbers

b)

Displays a message on the screen

c)

Saves a file

d)

Opens a webpage

2.

What will be the output of the following code?

print("Hello, World!")

a)

Hello World

b)

Hello,World

c)

Hello, World!

d)

Hello! World!

3.

Which of the following can be printed using the print() function?

a)

Numbers only

b)

Text only

c)

Both numbers and text

d)

Only emojis

4.

What will be the output of this code?

print(5+3)

a)

53

b)

8

c)

5+3

d)

35

5.

What happens if we write print( ) without anything inside the brackets?

a)

It shows an error

b)

It prints None

c)

It prints a blank line

d)

It prints Empty

6.

Which of the following is correct syntax for a print statement?

a)

a) print "Hello"

b)

b) print(Hello)

c)

c) print("Hello")

d)
  1. d) print("Hello" + )

7.

What is the error in the following code?

print "Hello, World!"

a)

Missing + between words

b)

No error

c)

Missing parentheses ( )

d)

Extra space after print

8.

Identify the error in this code:

print "Hello, World!"

a)

a) Strings must be enclosed in quotes

b)

b) print is spelled wrong

c)

c) Missing a comma between Hello and World

d)

d) No error

9.

What is the error in this code?

print("The sum of 5 and 3 is:", 5, +, 3)

a)

a) Extra comma after 5

b)

b) The + symbol should not have commas around it

c)

c) It should be print("The sum of 5 and 3 is:", 5 + 3)

d)

d) No error

10.

What will be the output of the following code?

a = 10

b = 20

print( a + b)

a)

10

b)

20

c)

30

d)

Error