Generation

generate functionSat, 12 Nov 2022

Function to return highest length or first instance of even word from sentence as input

def high_word(sentence): words = sentence.split() lengths = [x for x in map(len(x), words)] highest = max(lengths) i = lengths.index(highest) return words[i] high_word("I went to the store and bought some chocolate.")

Questions about programming?Chat with your personal AI assistant