why am i getting ValueError: max() arg is an empty sequence

def longest_word(text):
z =
x = text.split()
for i in x:
f = z.index(max(z))
return x[f]

What is the value of x at for i in x:?

Please edit your post and paste your code between backtics like this:

<paste code here>