Generation

generate functionTue, 22 Oct 2024

pide una frase y analiza cual es la palabra más larga, indicando cuántas letras tiene

def word_length(sentence): words = sentence.split() longest_word = "" for word in words: if len(word) > len(longest_word): longest_word = word return longest_word # Function to find the longest word in a sentence def longest_word(sentence): words = sentence.split() longest_word = ""

Want to kickstart your project?Use the new AI Studio to create your code