Guys, I have a question. In this programme, I do not know where is mistake.
Task is: List of names. We need to process the export of employee names from the company's information system. The list of employees in the text file contains firstly only first names (one first name in each line - it can be multi-word) and next lines contain only surnames (the order of first and last names is preserved). Create a program that: (a) reads the names from the file, finds and lists the number of names in the file b) find and list the longest first name (multiple first names are considered as one long first name) c) find and list the longest surname d) create a result file with a list of employees (serial number, first name and last name) and write it to the file My program: subor = open('mena.txt', 'r') name = [] for line in subor: meno.append(row.strip()) number_of_names = len(name) print("Number of names in the file:", pocet_menus) longest_name = max(name, key=len) print("The longest name is:", longest_name) lastname = [] for line in subor: lastname.append(row.strip()) longest_lastname = max(lastname, key=en) print("The longest last name is:", longest_last_name) result = open('mena.txt', 'w') for i in range(number_of_names): subor_result.write(str(i+1) + ". " + firstname[i] + " " + lastname[i] + "\n") result.close() subor.close() It always writes to me max() arg is an empty sequence. This is my text files: Anna Fero Dita Adam Jana Great Small Medium High Small