← Previous Next →

Longest word

Created by Julien Palard

Instructions

Write a function giving the longest word in a given text.

Your function should be named longest_word, take a single argument text and return a string which should be the longest word in the given text.

Beware: the given text can span several lines.

Example

>>> longest_word("We want a SHRUBBERY")
"SHRUBBERY"

Advice

Read the documentation of the len builtin function.

Your Code

Login to check your code and save your progress.