I need to write a script that finds all of the capitalized words (not words in all caps, just the initial letter) in a text file and presents them in alphabetical order.
I tried to use a regex like this:
re.findall(r'\b[A-Z][a-z]*\b', line)
but my function returns this output:
Enter the file name: bzip2.txt
['A', 'All', 'Altered', 'C', 'If', 'Julian', 'July', 'R', 'Redistribution', 'Redistributions', 'Seward', 'The', 'This']
How can I remove all the single-letter words (ex: A, C, and R)?