Question Detail

COS 102 lecture 4 Objective Question

Question

What is the primary role of variables in Python programming?
Options
A To perform arithmetic operations.
B To define functions and classes.
C To store data values that can be accessed or changed, and point to memory locations.
Correct Answer
D To handle errors and exceptions within a program.
Correct Answer

Option C is the correct answer.

Detailed Explanation

Page 23 states: 'Variables are containers for storing data values that can be access or change.' and 'It is a way of pointing to a memory location used by a program.'

Hint

The first two bullet points on page 23 under 'Variables' directly answer this.

Question Info