Login and get codingAs you have probably seen on the dashboard you can now gain Ninja Belts based on the amount of points (or Bitecoins) you gained solving Bites, ranging from white (10 points) to red (1000 points).
Complete the
get_belt
function below which receives auser_score
,scores
andbelts
.Based on the user's score, the function should return the corresponding belt name.
For example with 162 points you would have the orange belt (not yet reached green = 175 points), 401 points gets you the brown belt, 999 is paneled, etc.
Note that the
scores
are inclusive so if you have 10 points you have earned the white belt, ≥ 50 = yellow belt, etc.Also make sure you take the min and max boundaries into account:
- Less than 10 there no belt in which case you have to return
None
.- In case of more than 1000 points you have the highest belt (
red
).Keep calm and code in Python!
265 out of 265 users completed this Bite.
Will you be the 266th person to crack this Bite?
Resolution time: ~41 min. (avg. submissions of 5-240 min.)
Our community rates this Bite 4.2 on a 1-10 difficulty scale.
» Up for a challenge? 💪