The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

Strings in python

Strings in python

1
Vote
1
Answer

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?

1 Answer

365 Team
0
Votes

Hi Subhadeep, 
This is an excellent question and there are different approaches you could try. 
I suggest you take a look here:
https://www.geeksforgeeks.org/python-program-to-count-words-in-a-sentence/
Or you could test your own approach and let us know what you’ve come up with. 
 
Best, 
Eli

×
LAST CHANCE
Ready to Learn Data Science?
50% OFF