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