promptdojo_

elif chains and the match statement Cursor reaches for — step 8 of 9

Write an if/elif/else chain that takes the variable temp = 72 and prints exactly one of these labels:

  • "hot" if temp >= 85
  • "warm" if temp >= 70
  • "cool" if temp >= 55
  • "cold" otherwise

For temp = 72, the expected output is:

warm

full-screen editor opens — close anytime to keep reading.