Find the best solutions to your questions at Westonci.ca, the premier Q&A platform with a community of knowledgeable experts. Our platform connects you with professionals ready to provide precise answers to all your questions in various areas of expertise. Experience the convenience of finding accurate answers to your questions from knowledgeable experts on our platform.

we are writing a program that takes a word and checks how many letters​

Sagot :

fichoh

Answer:

def word_count(word):

return len(word)

a = word_count('scream')

print(a

Explanation:

Using python3:

def word_count(word):

#defines a function named word_count which takes in a single argument which is the word to be counted

return len(word)

#The only thing the function does is to count the number letters in the word.

For instance :

return len(word)

Calling the function and attaching it to the variable named a

Counts the number of letters in scream and assigns the result to a

a = word_count('scream')

print(a)

a gives an output of 6 ; which is the number of letters in scream.