# The issue happen with dictionary created with dict.fromkeys() method # When add new sub item to the 'webcam' item, this new sub item is also added to the 'ipcam' item # This issue also happen when you pop items from dict og_dict = { 'webcam' : 'huh', 'ipcam' : 'abc', } new_dict_1 = dict.fromkeys(og_dict.keys(), {}) print('1', new_dict_1) # add new item new_dict_1['webcam']['0'] = 'vaicalon' print('after adding new item to webcam item: ', new_dict_1) print('------------------------------------------------') new_dict_2 = { 'webcam': {}, 'ipcam': {} } print('2', new_dict_2) # add new item new_dict_2['webcam']['0'] = 'vaicalon' print('after adding new item to webcam item: ', new_dict_2)