-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchallenge.py
15 lines (15 loc) · 943 Bytes
/
challenge.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 1. Note the variable account_types, the list of account types.
# 2. Create a function called gatekeeper that returns the following error message strings in the following scenarios:
# For “admin”:
# program says “You have the privileges.”
# For “user”:
# program says “You have limited privileges.”
# For “guest”:
# program says “You have no privileges.”
# 3. Call your function with a string and print what it returns.
# 4. How could this code be improved? Make it better. Think about what other scenarios you should cover in your if logic.
# 5. Create a function called check_balance that takes one parameter, loan_balance.
# 6. If loan_balance is zero or more, it says “you don’t owe any money”
# 7. If loan_balance is negative, it says “you owe $X” where X is the amount
# 8. Call your function with a negative and positive number and print what it returns.
account_types = ["admin", "user", "guest"]