ExamVeda
Login
Home
Python Built In Functions
?

What will be the output of the following Python function?
float(‘-infinity’)
float(‘inf’)

Answer & Solution
Correct Answer: Option A
The float() function in Python is used to convert a string or a number to a floating-point number.
When you pass the string 'inf' to the float() function, it returns positive infinity.
When you pass the string '-infinity' to the float() function, it returns negative infinity.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.