Computer Science, asked by omranjan9211, 6 months ago

Q.4.Which of the following expressions result in an error:

float('12')

int('12')

float('12.5')

int('12.5')​

Answers

Answered by mshiv7362
15

Answer:

Answer A float ('12') it's correct answer

Answered by sanket2612
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