From dc3e5b80be7ed187fd96a75f01c7e8b883006f0b Mon Sep 17 00:00:00 2001 From: Arpna <100352419+Arpcoder@users.noreply.github.com> Date: Fri, 17 May 2024 11:50:39 +0530 Subject: [PATCH] Updated indentation of the python code --- contrib/mini-projects/wordcounter.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/mini-projects/wordcounter.md b/contrib/mini-projects/wordcounter.md index 0c08e2e..5f865da 100644 --- a/contrib/mini-projects/wordcounter.md +++ b/contrib/mini-projects/wordcounter.md @@ -30,7 +30,7 @@ The provided code defines a Python function count_words(sentence) aimed at count 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. Finally, it prints out the number of words in the sentence. - def count_words(sentence): + def count_words(sentence): # Split the sentence into words words = sentence.split() @@ -39,8 +39,8 @@ The provided code defines a Python function count_words(sentence) aimed at count return word_count - # Example usage: - sentence = input("Enter a sentence: ") - number_of_words = count_words(sentence) - print("Number of words:", number_of_words) + # Example usage: + sentence = input("Enter a sentence: ") + number_of_words = count_words(sentence) + print("Number of words:", number_of_words)