Can someone please explain to me what the last line of this loop does? It's a snippet from a word jumble program that is an example from a book I am learning from. Thank you.
import random
WORDS = ("python", "jumble", "easy", "difficult", "answer", "xylophone")
word = random.choice(WORDS)
correct = word
jumble = " "
while word:
position = random.randrange(len(word))
jumble += word[position]
word = word[:position] + word[(position +1):]