20
QuizMultiple Choice

Iteration — Unit test

Question 20 • VA-Information Technology Fundamentals B

What kind of data type would a Python programmer assign a variable to indicate a fractional number?

Answer
A
int
B
str
C
float
D
list

Explanation

A fractional number, such as 2.5, is represented in Python with the float data type. The correct choice is float. An int is for whole numbers, str is for text, and list stores a collection of values.

AI-written and checked against the verified answer.

Previous
Next