Menu

Using Subroutines - Code Quiz

1. What kind of error will this program produce?

import turtle def draw_line() turtle.forward(100) turtle.right(90)
Syntax error
Logic error
Runtime error
No error

2. Which line should replace the comment so the program draws one square?

import turtle def draw_square(): for i in range(4): turtle.forward(100) turtle.right(90) # line missing here
turtle.draw_square()
def draw_square():
draw_square()
draw_square

Log in or sign-up to access the quiz



Don't have a login?

You can still revise this topic