Login and get codingCreate a function that takes a username and checks for a valid user:
- The username is in
USERS
,- the user is not expired, and
- the user has the
ADMIN
role.If those 3 conditions are met return
SECRET
.If one of the conditions is not
True
raise an exception you define yourself:UserDoesNotExist
,UserAccessExpired
andUserNoPermission
respectively. Check out the tests for more detail.Have fun and keep calm and code in Python!
252 out of 260 users completed this Bite.
Will you be Pythonista #253 to crack this Bite?
Resolution time: ~44 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 4.17 on a 1-10 difficulty scale.
» Up for a challenge? 💪