Code 11: Count the total number of words in a string in Python | 365 Days of Code

Опубликовано: 23 Ноябрь 2024
на канале: Code House
247
1

Here is the python program to count the total number of words in a string.

Code -
string = "Hello, This is Mayank Gupta, and I run Code House"
string_list = string.split()
print(string_list)
print("Total number of words is", len(string_list))
Thanks