Which of the following methods is used to retrieve the fractional and integer parts of a float separately?
-
A
frac()
-
B
modf()
Correct answer
-
C
fraction()
-
D
split()
14 views
Explanation
The modf() method returns the fractional and integer parts of a float as a tuple.
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ