LearnPy Hub
← Decorators problems
Medium

Only Admins Allowed

Write a decorator admin_only for functions whose first argument is a user role: if the role isn't admin, return access denied instead of calling the function. Decorate delete(role, item) returning deleted ITEM. Read lines role item until END.

Input

Lines, then END.

Output

Lines.

Sample 1

Input
admin post1
student post2
END
Output
deleted post1
access denied

Sample 2

Input
teacher x
END
Output
access denied
solution.py
Output appears here
Only Admins Allowed · Python practice problem · LearnPy Hub