>>> s = "a aa aaa aa"
>>> max(s.split(), key=len)
'aaa'
split() splits the string into words (seperated by whitespace); max() finds the largest element using the builtin len() function, i.e. the string length, as the key to find out what "largest" means.