Question: file = open(example.txt) ## opens the text file line = file.read().replace( , ) ## reads the file as string removes any newline characters file.close()

file = open("example.txt") ## opens the text file line = file.read().replace(" ", " ") ## reads the file as string removes any newline characters file.close() print(line) ## prints the read string from input txt file alphabet_list=list(set(line.replace(" ", ""))) ## get list of unique alphabets after removing whitespace in the txt file sorted(alphabet_list) ## sorts the alphabets as per your requirements

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!