Python exercise · about 5 minutes · free
Filter a Dictionary: Catch the Aimbot
Nobody has 99% accuracy. The data knows.
Anomaly detection starts simply: pick a threshold, flag whatever crosses it.
[k for k, v in d.items() if v > 0.9]
Worked example (different data from your task)
temps = {"Pune": 31, "Leh": 4, "Delhi": 39}
hot = [city for city, t in temps.items() if t > 35]
print(hot) # ['Delhi']Common mistake: > and >= differ: "above 0.95" means >. Loop over .items() to get both the name and the value.
Your quest: Set
suspects to every player whose accuracy is above 0.95.Try it now Runs in your browser. No sign-in needed. Ctrl+Enter to run.
Hint
[name for name, acc in accuracy.items() if acc > 0.95]Output appears here.