Applied the .get method to retrieve value associated with the key
editing test
matching PEP 8 styling for creating a dictionary
added type errors