Reference no: EM132355103
Question
Write a function long strings that has one argument: file name that is a string that is the name of a text file. The file will consist of a number of lines of text, and each line will consist of a number of strings, separated by one or more space characters.
The command long strings(file name) should return a set that contains all of the longest strings that are found in the file.
Note that the strings found in the lines of the file may consist of any nonwhitespace characters, including letters, digits, and punctuation symbols.
If the file only consists of lines that contain spaces, then the function should return the empty set. For example, if the file question 1.txt consists of the following five lines of text: If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character!! in x will be mapped to the chAracters at the same #positi%on! in y.
If there is a third arg,!ument, it 3 must be a string, whose characters will be mapped to None in the result. then long strings('question 1.txt') should return the set {'#positi%on!', 'arg,!ument,', 'character!!', 'dictionary,'}, since each of the strings in this set have length 11 and no string in the file has a longer length.