Login and get coding
As 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).
get_beltfunction below which receives a
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
scoresare 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
- In case of more than 1000 points you have the highest belt (
Keep calm and code in Python!
256 out of 256 users completed this Bite.
Will you be Pythonista #257 to crack this Bite?
Resolution time: ~41 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 4.2 on a 1-10 difficulty scale.
» Up for a challenge? 💪