Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Programming Basics Quiz

Total questions: 14

Worksheet time: 7mins

Name
Class
Date
1.

Who made Python?

a)

Leonardo Da Vinci

b)

Monty Python

c)

Russell Crowe

d)

Guido Van Russum

2.

Why is Python called Python?

a)

The inventor loved playing the snake game.

b)

The inventor really enjoyed the ‘Monty Python’ series.

c)

The inventor just liked snakes.

d)

A python bit the inventor when he was making it.

3.

What are the different types of data types in Python?

a)

Integers

b)

Floats

c)

Strings

d)

Booleans

e)

All of the above

4.

Which of the following is a mutable data structure?

a)

Tuple

b)

List

c)

String

d)

Set

5.

What is Syntax?

a)

A tax that programmers have to pay

b)

The decided structure for each programming language

c)

A tax that must be paid when you forget punctuation

d)

The meaning of a word

6.

What function is used to print output in Python?

a)

print()

b)

output()

c)

show()

d)

display()

7.

Which of the following is NOT a valid data type in Python?

a)

B. float

b)

D. str

c)

C. char

d)

A. int

8.

Fill in the blank space: An (a)   is when a function lives within a class

9.

What is the purpose of a for loop in Python?

a)

To iterate over a sequence

b)

To create a function

c)

To define a variable

d)

To handle exceptions

10.

What is the purpose of a while loop in Python?

a)

To repeat a block of code as long as a condition is true

b)

To create a list

c)

To define a function

d)

To print output

11.

How do you make a comment in Python?

a)

Precede with ‘/*’ and end with ‘*/’

b)

Use ‘//’ before each comment

c)

Use ‘#’ before the comment

d)

Write the comment backwards

12.

What is the main purpose of OOP in programming?

a)

To organize code into reusable and maintainable components

b)

To make code less readable and harder to maintain

c)

To limit the reusability of code components

d)

To increase the complexity of the codebase

13.

Functions do not work unless...

a)

They are called

b)

They are taken

c)

They are removed

d)

They are displayed

14.

Fill in the blank: An (a)   is a value passed to a function or method when is called