Using the computational language in python we have to use it to write to a file and read with the code.
filename = input()
file = open(filename)
lines = file.readlines()
data = {}
for i in range(0, len(lines), 2):
num_seasons = int(lines[i].strip())
show = lines[i + 1].strip()
if num_seasons not in data:
data[num_seasons] = []
data[num_seasons].append(show)
file.close()
file_writer = open('output_keys.txt', 'w')
titles = []
for num_seasons in sorted(data):
shows = []
for show in sorted(data[num_seasons]):
titles.append(show)
file_writer.write(str(num_seasons) + ': ' + '; '.join(data[num_seasons]) + '\n')
file_writer.close()
file_writer = open('output_titles.txt', 'w')
for title in sorted(titles):
file_writer.write(title + '\n')
file_writer.close()
See more about python at brainly.com/question/18502436
#SPJ1