Which of the following is a valid float in Python?
-
A
10
-
B
-5.6
Correct answer
-
C
'3.14'
-
D
[1, 2, 3]
16 views
Explanation
Floats can represent both positive and negative numbers with decimal points. -5.6 is a valid float.
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ