1.

Which of the following expressions is an example of type conversion?(a) 4.0 + float(3)(b) 5.3 + 6.3(c) 5.0 + 3(d) 3 + 7I have been asked this question in homework.The query is from Precedence and Associativity topic in chapter Precedence and Associativity, Bitwise & Boolean of Python

Answer» CORRECT answer is (a) 4.0 + float(3)

For EXPLANATION: Type conversion is nothing but explicit conversion of OPERANDS to a SPECIFIC type. Options 5.3 + 6.3 and 5.0 + 3 are examples of implicit conversion whereas OPTION 4.0 + float(3) is an example of explicit conversion or type conversion.


Discussion

No Comment Found

Related InterviewSolutions