wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Grade 7 Python Programming Quiz

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

Who created the Python programming language?

a)

Bill Gates

b)

Guido van Rossum

c)

Elon Musk

d)

Mark Zuckerberg

2.

When was Python first released?

a)

1991

b)

2000

c)

1985

d)

2010

3.

Which of the following is the correct way to print "Hello World" in Python?

a)

echo "Hello World"

b)

print("Hello World")

c)

say "Hello World"

d)

printf("Hello World")

4.

What symbol is used to start a comment in Python?

a)

//

b)

--

c)

#

d)

/*

5.

What does the following code print? print(5 + 3)

a)

53

b)

8

c)

5 + 3

d)

Error

6.

Which data type is used to store text in Python?

a)

int

b)

float

c)

string

d)

bool

7.

What will this code output? print("Hello" + " World")

a)

HelloWorld

b)
  • "Hello" + "World"

c)

Hello World

d)

Error

8.

What does this code do?

name = "Sarah"

print("Hi", name)

a)

Prints Hi name

b)

Prints name Sarah

c)

Prints Hi Sarah

d)

Gives an error

9.

What does the input() function do in Python?

a)

Shows output

b)

Gets user input

c)

Prints text

d)

Defines a loop

10.

Which keyword is used to make decisions in Python?

a)

repeat

b)

if

c)

define

d)

choose

11.

What will be the output of this code? print("I love" + " Python")

a)

I love Python

b)

I lovePython

c)

"I love" + " Python"

d)

I + Python

12.

What will the following code print? print(10 - 4)

a)

6

b)

104

c)

10 - 4

d)

Error

13.

What is the purpose of a variable in Python?

a)

To display messages on the screen

b)

To store information that can be used later

c)

To create graphics

d)

To turn off the computer

14.

What does this code print? name = "Aisha" print("Hello", name)

a)

HelloAisha

b)

Hello name

c)

Hello Aisha

d)

name Hello

15.

What will be the output of this code?

x = 10

y = 5

print(x * y)

a)

15

b)

105

c)

5

d)

50

16.

Why is the language called "Python"?

a)

It's named after a snake

b)

The creator liked Monty Python comedy

c)

It's short for "Program Language"

d)

Python is fast like a snake

17.

What does this code print?

age = 14

if age > 13:

print("You are a teenager")

a)

Nothing

b)

You are a teenager

c)

age . 13

d)

error

18.

Python is known for being...

a)

Difficult to read

b)

Used only in games

c)

Easy to learn and read

d)

A low-level language

19.

What data type is the value 42 in Python?

a)
  • string

b)
  • float

c)
  • int

d)
  • bool

20.

Which of these can Python be used for?

a)

Web development

b)

Data science

c)

Game design

d)

All of the above