Q.4.Which of the following expressions result in an error:
float('12')
int('12')
float('12.5')
int('12.5')
Answers
Answered by
15
Answer:
Answer A float ('12') it's correct answer
Answered by
2
Answer:
The correct option is Option D i.e. int('12.5').
Explanation:
Float () is a method that returns a floating point number for a specified number or string.
Float () returns a value based on the passed argument or parameter value.
If no value or empty parameter is passed, the value 0,0 is returned as floating point output.
The int() method returns an integer object from any number or string.
It considers 10 as the default base.
Hence, int('12.5') results in an error.
#SPJ3
Similar questions
Math,
3 months ago
Math,
3 months ago
Biology,
7 months ago
Math,
7 months ago
Physics,
11 months ago
Social Sciences,
11 months ago
Political Science,
11 months ago