if, elif and a final return.
def label(t):
if t > 30:
return "hot"
elif t > 20:
return "warm"
elif t > 10:
return "mild"
return "cold"
print(label(30), label(10), label(21))
What does the program print?Log in to join the discussion.
Loading…