Generating the Thue-Morse Sequence using Python

Prompt

Result