What will be the output of the following Python code? [code]t=32.00 [round((x-32)*5/9) for x in t][/code]

What will be the output of the following Python code?
Code:
t=32.00
[round((x-32)*5/9) for x in t]
A. [0]
B. 0
C. [0.00]
D. Error
 
Answer: d
Explanation: The value of t in the code shown above is equal to 32.00, which is a floating point value. ‘Float’ objects are not iterable. Hence the code results in an error.
 

Tìm kiếm

Back
Top