@sylvester Вы можете использовать метод распаковки словарей для их объединения.
1 2 3 4 5 6 7 8 |
first_array = {"Philosophers stone" : 15, "Chamber of Secrets" : 20, "Prisoner of Azkaban" : 10, "Goblet of Fire" : 14} second_array = {"Order of the Phoenix" : 20, "Half-Blood Prince" : 16, "Deathly Hallows" : 24} total_chapters = {**first_array, **second_array} print(total_chapters) # Вывод : {'Philosophers stone': 15, 'Chamber of Secrets': 20, 'Prisoner of Azkaban': 10, 'Goblet of Fire': 14, 'Order of the Phoenix': 20, 'Half-Blood Prince': 16, 'Deathly Hallows': 24} |