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))
Get live Maths 1-on-1 Classs - Class 6 to 12