- Name the file Ex9-Dictionaries.py.
- Define a dictionary called
users.
- Add three users (for example: Bernard, Charlotte, Teddy) as keys in the
users dictionary.
- For each user, create a nested dictionary similar to the cities example as the value that includes:
role
securityQuestion
securityAnswer
- In the terminal, print each userβs name and all stored information by looping through the
users dictionary. Use the following format for the output:
1User: Bernard
2 Role: Administrator
3 Chose the following secuirty question: What was the name of your first dog?
4 Answered to the security question: Scully.
5
6User: Charlotte
7 Role: Guest
8 Chose the following secuirty question: What is your favorite color?
9 Answered to the security question: Purple.
10
11User: Teddy
12 Role: Guest
13 Chose the following secuirty question: In which city were you born?
14 Answered to the security question: Cullowhee.