i have dictionary: dict = {key1:value1, key2:value2, key3:value3, key1:value4, key2:value5, key3:value6}
if i print keys from dictionary
def my_func():
for key in dict:
print(key)
it print only last 3 keys: for example:
key1
key2
key3
but keys in dictionary can be same. Can you explain me why? if the key is the same, how to print like this:
key2:value2,value5
if it is possible. thank you in advance.