How to count the number of words in a string?
suppose I want to .upper() whole string if user input of the string contains 3 words.
Or .lower if it contains only one word?
This is an excellent question and there are different approaches you could try.
I suggest you take a look here:
Or you could test your own approach and let us know what you’ve come up with.