Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Vocabulary Quiz 2023

Total questions: 35

Worksheet time: 35mins

Name
Class
Date
1.

What is the purpose of syntax in Python?

a)

To define the scope of code blocks

b)

To store data in named containers

c)

To specify the type of a variable

d)

To dictate how Python code should be structured and written

2.

What is a variable in Python?

a)

A collection of key-value pairs

b)

A reusable block of code

c)

A named container for storing data

d)

An ordered collection of items

3.

Which data type specifies a sequence of characters?

a)

String

b)

Integer

c)

Float

d)

Boolean

4.

What is an integer in Python?

a)

A whole number without a decimal point

b)

A number with a decimal point

c)

A data type that represents either True or False

d)

An ordered collection of items

5.

What is a float in Python?

a)

A whole number without a decimal point

b)

A number with a decimal point

c)

A data type that represents either True or False

d)

An ordered collection of items

6.

What is a boolean in Python?

a)

A whole number without a decimal point

b)

A number with a decimal point

c)

A data type that represents either True or False

d)

An ordered collection of items

7.

What is a list in Python?

a)

A collection of key-value pairs

b)

A reusable block of code

c)

An ordered collection of items

d)

An instance of a class

8.

What is a tuple in Python?

a)

A collection of key-value pairs

b)

An ordered, immutable collection of items

c)

An ordered collection of items

d)

An instance of a class

9.

What is a dictionary (dict) in Python?

a)

A collection of key-value pairs

b)

A reusable block of code

c)

An ordered collection of items

d)

An instance of a class

10.

What is a loop in Python?

a)

A control structure that repeatedly executes a block of code

b)

A named container for storing data

c)

A classification that specifies which type of value a variable can hold

d)

A sequence of characters enclosed in quotes

11.

What is a function in Python?

a)

A control structure that repeatedly executes a block of code

b)

A reusable block of code that performs a specific task

c)

A classification that specifies which type of value a variable can hold

d)

A sequence of characters enclosed in quotes

12.

What is a module in Python?

a)

A control structure that repeatedly executes a block of code

b)

A file containing Python code that can be imported and used in other scripts

c)

A classification that specifies which type of value a variable can hold

d)

A sequence of characters enclosed in quotes

13.

What is a library in Python?

a)

A control structure that repeatedly executes a block of code

b)

A collection of modules that provide pre-written code to perform various tasks

c)

A classification that specifies which type of value a variable can hold

d)

A sequence of characters enclosed in quotes

14.

What is a conditional statement in Python?

a)

A control structure that repeatedly executes a block of code

b)

A control structure that allows you to execute code based on certain conditions

c)

A classification that specifies which type of value a variable can hold

d)

A sequence of characters enclosed in quotes

15.

Which data type specifies a sequence of characters enclosed in quotes?

a)

String

b)

Integer

c)

Float

d)

Boolean

16.

What is an ordered collection of items, which can be of different data types?

a)

List

b)

Tuple

c)

Dictionary

d)

Loop

17.

What is an ordered, immutable collection of items?

a)

List

b)

Tuple

c)

Dictionary

d)

Loop

18.

What is a collection of key-value pairs?

a)

List

b)

Tuple

c)

Dictionary

d)

Loop

19.

Which control structure repeatedly executes a block of code?

a)

Function

b)

Loop

c)

Conditional Statement

d)

Exception

20.

What is a reusable block of code that performs a specific task?

a)

Function

b)

Loop

c)

Conditional Statement

d)

Exception

21.

Which control structure allows you to execute code based on certain conditions?

a)

Function

b)

Loop

c)

Conditional Statement

d)

Exception

22.

What is the whitespace at the beginning of lines in Python that defines the scope of code blocks?

a)

Indentation

b)

Exception

c)

Package

d)

Class

23.

What is an error that occurs during program execution?

a)

Indentation

b)

Exception

c)

Package

d)

Class

24.

What is a class in Python?

a)

A collection of related Python modules organized into directories.

b)

A blueprint for creating objects, which defines attributes and methods.

c)

A file containing Python code, which can be imported and used in other Python scripts.

d)

An instance of a class, which has attributes and can perform methods.

25.

What is an iterable in Python?

a)

A collection of related Python modules organized into directories.

b)

A blueprint for creating objects, which defines attributes and methods.

c)

A file containing Python code, which can be imported and used in other Python scripts.

d)

An object that can be looped over, such as lists, tuples, and dictionaries.

26.

What is indexing in Python?

a)

A collection of related Python modules organized into directories.

b)

A blueprint for creating objects, which defines attributes and methods.

c)

Accessing individual elements in an iterable by their position, starting from 0.

d)

An instance of a class, which has attributes and can perform methods.

27.

What is a slice in Python?

a)

A collection of related Python modules organized into directories.

b)

A blueprint for creating objects, which defines attributes and methods.

c)

A way to extract a portion of an iterable by specifying a range of indices.

d)

An instance of a class, which has attributes and can perform methods.

28.

What is debugging in Python?

a)

A collection of related Python modules organized into directories.

b)

A blueprint for creating objects, which defines attributes and methods.

c)

The process of identifying and fixing errors and issues in your Python code.

d)

An instance of a class, which has attributes and can perform methods.

29.

What is the purpose of a package in Python?

a)

To organize related Python code into directories.

b)

To create blueprints for objects in Python.

c)

To define attributes and methods for objects in Python.

d)

To provide pre-written code for various tasks in Python.

30.

What is the purpose of a class in Python?

a)

To organize related Python code into directories.

b)

To create blueprints for objects in Python.

c)

To define attributes and methods for objects in Python.

d)

To import and use Python code in other scripts.

31.

What is the purpose of an object in Python?

a)

To organize related Python code into directories.

b)

To create blueprints for objects in Python.

c)

To define attributes and methods for objects in Python.

d)

To create instances of a class with attributes and methods.

32.

What is the purpose of an iterable in Python?

a)

To organize related Python code into directories.

b)

To create blueprints for objects in Python.

c)

To define attributes and methods for objects in Python.

d)

To loop over and access elements in Python, such as lists, tuples, and dictionaries.

33.

What is an algorithm?

a)

A set of steps for performing a task, like a recipe.

b)

To add something to the end; for example, adding letters onto the end of a string or adding elements to the end of a list or array.

c)

A value passed to a function.

d)

A rhythm designed for people named "Al."

34.

Comments are

a)

statements only the computer can understand.

b)

programming notes or reminders that the computer ignores.

c)

not appreciated.

d)

statements that allow the computer to test a value and perform different actions depending on the outcome of that test.

35.

Joining two or more strings together to make a larger string is called?

a)

Boolean

b)

Iteration

c)

Concatenation

d)

Decomposition