D1 = {1:40, 2:70, 3:70} D2 = {1:40, 2:50, 3:60} D3 = {1:70, 2:80, 3:90} all_dict = {**D1, **D2, **D3} subject_3_values = [value for key, value in all_dict.items() if key == 3] highest_mark = max(subject_3_values) print(f"The highest mark in subject 3 is {highest_mark}.")