The variable age is to be used to represent a person's age, in years. Which of the following is the most appropriate data type for age?
Understand the Problem
The question is asking which data type is most appropriate for representing a person's age in years. It provides options such as Boolean, number, string, and list, and requires knowledge of data types in programming.
Answer
number
The final answer is number.
Answer for screen readers
The final answer is number.
More Information
Using 'number' is appropriate because age is typically an integer value that can be used in mathematical operations.
Tips
A common mistake is to use 'string' which is not suitable for arithmetic operations.
Sources
- Solved The variable age is to be used to represent a | Chegg.com - chegg.com
- Variables and Assignments | Quizizz - quizizz.com
AI-generated content may contain errors. Please verify critical information