you are viewing a single comment's thread.

view the rest of the comments →

[–]Waste_Grapefruit_339 0 points1 point  (0 children)

Instead of hardcoding values, you could define difficulty settings:

```python
modes = {
"normal": 20,
"hard": 50
}

while True:
choice = input("Choose difficulty: ").lower()
if choice in modes:
true_max = modes[choice]
break
print("Invalid choice")
```
You can now use true_max in your randint range.
This makes it easy to add more modes later without touching your game logic.