Python program to count number of words entered

 n=input("Enter String :")

f=len(n)

count=0

for i in range(0,f):

    z=ord(n[i])

    if z==32:

        count+=1

print("Number of words : ",count+1)

Comments

Popular posts from this blog

Binary Search, Linear Search, Selection Sort and Bubble sort Python Menu Program

Housie/Tambola using Python with Tickets in PDF file