Aluko Kenny

Generation

generate functionSun, 14 May 2023

Ask the user to copy and paste their text, count the amount of words in the text and print out results

def word_count(text): words = text.split() return len(words) text = input("Paste your text here and press enter: ") count = word_count(text) print("The number of words in your text is: " + str(count))

Questions about programming?Chat with your personal AI assistant