FC0-U71 · Question #164
Which of the following is an example of a float data type?
The correct answer is A. -2.34. The question asks to identify a value that represents a float data type.
Question
Which of the following is an example of a float data type?
Options
- A-2.34
- B0
- C12
- Dabc
How the community answered
(50 responses)- A88% (44)
- B4% (2)
- C2% (1)
- D6% (3)
Why each option
The question asks to identify a value that represents a float data type.
A float, or floating-point number, is a data type used to represent real numbers that have a fractional component. The value -2.34 explicitly contains a decimal point and a fractional part, clearly indicating it as a floating-point number.
The number 0 is an integer, as it does not have a fractional part, though it could be represented as a float (0.0).
The number 12 is an integer because it lacks any fractional or decimal component.
The value 'abc' is a string data type, which represents textual information, not a numeric type.
Concept tested: Programming data types - float, integer, string
Source: https://www.w3schools.com/python/python_datatypes.asp
Topics
Community Discussion
No community discussion yet for this question.