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
History,
3 months ago
Biology,
6 months ago
Math,
6 months ago
Physics,
10 months ago
Social Sciences,
10 months ago
Political Science,
10 months ago