def create_dog_breeds_dictionary(dog_breeds_list, dog_groups_list):
a_dictionary = dict()
for x in range(0, len(dog_breeds_list)):
a_dictionary[dog_groups_list[x]] = list(dog_breeds_list[x].split(","))
return a_dictionary
def print_key_values_in_order(a_dict):
for x, y in a_dict.items():
print(x, y)
This is a question I had for a lab at the university.
I have managed to work out the code for this but I solved it by seeing online that you can use a comma with a for loop and I'm not sure how exactly it works. So the bit I'm confused with is for x, y in a_dict.items():
How exactly does this for loop work?