Chewbacca and Number, Hackerblocks Tutorial

I have understood the problem but I am not able to understand the code through the video.
Can you please explain the code.