avatar Bite 12. Write a user validation function

Create a function that takes a username and checks for a valid user:

1. The username is in USERS

2. The user's account has not expired.

3. The user has the ADMIN role.

If those 3 conditions are met return SECRET.

If one of the conditions is not True, raise an appropriate exception:

- UserDoesNotExist

UserAccessExpired

- UserNoPermission

Remember to look at the tests for more details. Have fun, keep calm, and code in Python!

Login and get coding
go back Intermediate level
Bitecoin 3X

351 out of 357 users completed this Bite.
Will you be the 352nd person to crack this Bite?
Resolution time: ~45 min. (avg. submissions of 5-240 min.)
Our community rates this Bite 4.43 on a 1-10 difficulty scale.
» Up for a challenge? 💪

Focus on this Bite hiding sidebars, turn on Focus Mode.

Ask for Help