Skip to content

9. Lists

9.1 List Indexing

Instructions

Fix the code below so it functions correctly.

Code - Click to expand
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#-------------Setup----------------

import Ed

Ed.EdisonVersion = Ed.V3
Ed.DistanceUnits = Ed.CM
Ed.Tempo = Ed.TEMPO_MEDIUM

#--------Your code below-----------

# beeps num times
def beep_times(num):
    count = 0
    for x in range(num):
        Ed.PlayBeep()
        Ed.TimeWait(300, Ed.TIME_MILLISECONDS)


beeps = Ed.List(4, [4, 3, 2, 1])

# this loop will beep for the value in each list index
for x in range(3):
    beep_times(x)

    Ed.PlayMyBeep(16000)