Write Python code to find the number of words in a string input by the user.
Answer:
Code:
str=input(
"Enter a string: "
)
words=str.split()
print(len(words))
Learn in your speed, with individual attention - Teachoo Maths 1-on-1 Class