"The number of words: Given a string consisting of words separated by spaces. Determine how many words it has. To solve the problem, use the method count. " - Snakify python coding question

 



 

CODING QUESTION

Here is question


SOLUTION

s=str(input())
print(s.count(' ')+1)

 

Input : Hello world

Output : 2