Python AI Developer Course 4 Functions : Text Analyzer

Поділитися
Вставка
  • Опубліковано 3 лют 2025

КОМЕНТАРІ • 1

  • @michaelmananghaya5831
    @michaelmananghaya5831  24 дні тому

    # Function to count words
    def count_words(text):
    words = text.split() # Split the text by spaces to get a list of words
    return len(words) # Return the number of word
    # Function to check if a character is alphabetic
    def is_alpha(char):
    # Check if the character is between 'a' and 'z' or 'A' and 'Z'
    return ('a'