Question 16
What is the output of the following code?
Hint
Notice the initialized values of sun, wind, and rain.
What would their respective Boolean equivalents be?
Solution
if rain: True (1 is a truthy value) \(\Rightarrow\) enter if block.
if wind:True(1is a truthy value) \(\Rightarrow\) enter if block.- Print
'Cold'in the console.
- Print
- Print the value of
rain(i.e.,1), since it is still within theif rainblock.
Ignore the contents of the elif block that trail afterwards.