File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ The provided code defines a Python function count_words(sentence) aimed at count
3030 It then calls the count_words function, passing the user's input as an argument, and stores the returned word count in the variable number_of_words.
3131 Finally, it prints out the number of words in the sentence.
3232
33- def count_words(sentence):
33+ def count_words(sentence):
3434 # Split the sentence into words
3535 words = sentence.split()
3636
@@ -39,8 +39,8 @@ The provided code defines a Python function count_words(sentence) aimed at count
3939
4040 return word_count
4141
42- # Example usage:
43- sentence = input("Enter a sentence: ")
44- number_of_words = count_words(sentence)
45- print("Number of words:", number_of_words)
42+ # Example usage:
43+ sentence = input("Enter a sentence: ")
44+ number_of_words = count_words(sentence)
45+ print("Number of words:", number_of_words)
4646
You can’t perform that action at this time.
0 commit comments