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)
Logic error
Syntax error
No error
Runtime 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
draw_square()
def draw_square():
turtle.draw_square()
draw_square

Log in or sign-up to access the quiz



Don't have a login?

You can still revise this topic