Good suggestion rr, but I think that just capitalizes the first word of each line. Instead of readlines()
you want readwords()
, except that doesn't exist.
I think judicious use of split()
is in order, and remember each line will end with \n
so you'll want to be sure to delete that so it's not part of the word.