Bait and switch (Python)

Hi please format your code so I can read it more easily:

Thanks
Danny