Ask the user for their head circumference in inches and report the matching hat size and message.
if / elif / else| Circumference | Hat Size | Message |
|---|---|---|
| 20–21 | Small | Snug fit for speedy thinkers |
| 21–22.5 | Medium | Balanced and brilliant |
| 22.5–24 | Large | Roomy for big ideas |
| 24 and up | Extra Large | Legendary noggin detected |
Notice the bands share their edges — 22.5 appears on two rows. An elif chain settles that for you, because only the first matching branch runs. Work out which size 22.5 ends up as, and decide whether that is the one you wanted.
Enter your head size in inches: 23 [Enter]Hat size: LargeRoomy for big ideas.