File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed 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
30
30
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.
31
31
Finally, it prints out the number of words in the sentence.
32
32
33
- def count_words(sentence):
33
+ def count_words(sentence):
34
34
# Split the sentence into words
35
35
words = sentence.split()
36
36
@@ -39,8 +39,8 @@ The provided code defines a Python function count_words(sentence) aimed at count
39
39
40
40
return word_count
41
41
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)
46
46
You can’t perform that action at this time.
0 commit comments