Step 5: Detective Ranks ๐
The case works, the tries are counted โ now make it feel like a real game. Two finishing touches: an opening title screen, and a rank at the end based on how sharp you were. ๐ต๏ธ
You already know both tools; this is about pointing them at a number you made yourself:
if temperature <= 0:
print("Rank: FROZEN")
elif temperature <= 20:
print("Rank: Chilly")
else:
print("Rank: Toasty")
Order matters! Python checks top to bottom and stops at the first match, so the toughest rank goes first.
Your mission
- Open with a title screen: a banner line (
"=" * 32), a title, another banner, and a "can you crack the case?" welcome - Keep the secret, the while loop and the tries counter
- After the win, announce the rank with a second
if/elif/else:- 4 tries or fewer โ MASTER DETECTIVE ๐ต๏ธ
- 8 or fewer โ something like Pretty Sharp Sleuth
- otherwise โ Rookie in Training ๐ฃ
- Wrap the ending in banner lines too โ you earned the trophy case!
Your code
Press โถ Run to see what your code does!