I have been given a basic text file and I need to use regex in python to pull all the words for each line and print the number of words per line.
Text File Example:
I have a dog.
She is small and cute,
and likes to play with other dogs.
Example Output:
Line 1: 4
Line 2: 5
Line 3: 7
Any help would be appreciated!