Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Quiz

Total questions: 22

Worksheet time: 11mins

Name
Class
Date
1.

What is Python?

a)

A programming language

b)

A data structure

c)

A type of snake

2.

What is a list in Python?

a)

A collection of ordered elements

b)

A string of characters

c)

A mathematical operation

3.

What is a string in Python?

a)

A sequence of characters

b)

A floating-point number

c)

A boolean value

4.

What is a float in Python?

a)

A floating-point number

b)

A collection of ordered elements

c)

A type of snake

5.

What is a boolean in Python?

a)

A boolean value

b)

A programming language

c)

A string of characters

6.

What is a function in Python?

a)

A named block of code

b)

A mathematical operation

c)

A type of snake

7.

What is an operator in Python?

a)

A symbol that performs an operation

b)

A collection of ordered elements

c)

A boolean value

8.

What does the 'def' keyword do in Python?

a)

Defines a function

b)

Defines a variable

c)

Defines a loop

9.

What is a dictionary in Python?

a)

A collection of key-value pairs

b)

A floating-point number

c)

A type of snake

10.

What is an integer in Python?

a)

A whole number

b)

A programming language

c)

A string of characters

11.

What does the 'len' function do in Python?

a)

Returns the length of a sequence

b)

Performs a mathematical operation

c)

Checks if a value is true or false

12.

What does the 'remove' method do in Python?

a)

Removes an element from a list

b)

Adds an element to a list

c)

Sorts a list in ascending order

13.

What does the 'pop' method do in Python?

a)

Removes and returns the last element of a list

b)

Adds an element to a list

c)

Deletes a list

14.

What does the 'add' method do in Python?

a)

Adds two numbers

b)

Adds an element to a list

c)

Adds a key-value pair to a dictionary

15.

What does the 'delete' keyword do in Python?

a)

Deletes a variable

b)

Deletes a file

c)

Deletes a list

16.

What does the 'sort' method do in Python?

a)

Sorts a list in ascending order

b)

Sorts a dictionary by keys

c)

Sorts a string in alphabetical order

17.

What does the 'slice' operator do in Python?

a)

Extracts a portion of a sequence

b)

Performs a mathematical operation

c)

Checks if a value is true or false

18.

What is a matrix in Python?

a)

A two-dimensional array

b)

A floating-point number

c)

A type of snake

19.

What is a lambda function in Python?

a)

An anonymous function

b)

A named block of code

c)

A type of snake

20.

What is pandas in Python?

a)

A data manipulation library

b)

A programming language

c)

A string of characters

21.

What is numpy in Python?

a)

A numerical computing library

b)

A collection of ordered elements

c)

A boolean value

22.

data = "Hello World!"

The expression len(data) evaluates to:

a)

12

b)

11

c)

10

d)

14