'''lecture08_find_bug3.py Oliver W. Layton CS151: Computational Thinking: Visual Media Spring 2021 Find the 3 bugs below ''' import turtle import random def goto(x, y): '''This function is fine!''' turtle.up() turtle.goto(x, y) turtle.down() def drawLine(color, drawThickLine=False): '''Draws a thick or thin line at a random place on the canvas ''' if drawThickLine: turtle.width(8) x = random.randint(-200, 200) y = random.randint(-200, 200) goto(x, y) turtle.forward(100) turtle.width(1) def main(numLines): '''Draws a thick line 50% of the time and thin line 50% of the time at a random location on the canvas ''' for i in range(10): if random.random() < 0.5: drawThickLine = True drawLine('red') # Main code if __name__ == '__main__': numLines = 10 main(numLines) turtle.exitonclick()