Dictionaries are an amazing data structure that allow use to add and retrieve an item very quickly.
Submission Instructions
For each of the following practice assignments, save your solution in a .py file, with the name being dicts and the number of the assignment. For example, for Dicts01: Names, save your solution in a file named dicts01.py. Then, submit that file the respective assignment on codePost.io.
Practice Assignments
Dicts01: Login Validation
Compete the passwordCheck() function that will authenticate a user's login by accepting that user's name, their password, and a dictionary of users' login credentials. The function will return the str 'login successful' if the user's login information is correct and the str 'login failed' otherwise.
Complete the function charFrequency( ) so that it will accept a str, and use a dictionary to store each character’s frequency. Return the dictionary.
Suggested steps:
Create an empty dictionary
Traverse the string of characters, one at a time. For each character, use the character as the key. If the character's not in the dictionary, then add it. Otherwise, increment it's count.