Please try to use meaningful words, not so important now, but as your programs grow larger, and for others who read your code, it will become important.
when reading a file in 'r' mode, each read is delimited by a newline so you get a sentence, not a word.
you can extract any word by splitting into a list:
when reading a file in 'r' mode, each read is delimited by a newline so you get a sentence, not a word.
you can extract any word by splitting into a list:
mylist = a.read().strip().split() word1 = mylist[0] # remember lists are zero based.try printing mylist to see how sentence is split.