lambda work on the words of a sentence.
words = "the quick brown fox jumps".split()
long = [w[0].upper() for w in words if len(w) > 3]
print("".join(long), sorted(words, key=lambda w: w[-1])[0])
What does the program print?Log in to join the discussion.
Loading…