Answer each question in full sentences. Each answer starts as a placeholder marker. Replace
every marker with your own writing, and delete the marker itself. The minimum word count for
this document is 150 words.
Simon picks each light with
random.randint(0, len(leds) - 1). Explain why the second number islen(leds) - 1, and what could go wrong withrandom.randint(0, len(leds)).
TODO
The button is made with
Pin.PULL_UP. Explain whatbutton.value()returns before a press and during one, and how thewhileloop in Stage Three uses that to decide when a step is answered.
TODO
Simon's sequence is
[2, 0, 1]and your answer is[2, 1, 1]. Trace Stage Four: what doescorrecthold after each trip of the loop, and what do the last two lines of the log say?
TODO