Consider the following python code:
def carDict(data): d = dict() for c in data: if c not in d: d[c] = 1 else: d[c] += 1 return dcars = ['bmw', 'ford', 'toyota', 'ford', 'ford', 'bmw']tracker = carDict(cars)
1) How would you iteratively print out all the key value pairs in the dictionarytracker, using a loop?
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here