0

Here is the code i used to create an Edice for microbit: from microbit import * import random image1 = Image("00000:" "00000:" "00900:" "00000:" "00000") image2 = Image("90000:" "00000:" "00000:" "00000:" "00009") image3 = Image("90000:" "00000:" "00900:" "00000:" "00009") image4 = Image("90009:" "00000:" "00000:" "00000:" "90009") image5 = Image("90009:" "00000:" "00900:" "00000:" "90009") image6 = Image("90009:" "00000:" "90009:" "00000:" "90009") images=[image1, image2, image3, image4, image5, image6]

while True: if button_a.is_pressed(): for i in range(0, 16):

        display.show(images)
        display.show(random.randint.(1, 6))
        sleep(20)
        display.clear
    display.show(image(random.randint(1, 6)))

display.show(random.randint.(1, 6)) seems to be registered as a synatax error. May I know what is the problem and how i can improve on the code

1 Answer 1

1

There is an extra .

You wrote: display.show(random.randint.(1, 6))
It should be: display.show(random.randint(1, 6))

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.