Codehs Python Exam | Questions with Correct Answers| Verified
for loopAnswerrepeats a set of commands
indentationAnswerThe placement of text farther to the right necessary for the for loop or
functions as a way to show what commands are part of them
setheading(90)AnswerSet the orientation of the turtle to north (up)
seth(0)AnswerSet the orientation of the turtle to East
functionAnswerhelps the code to be reused and to be more organised
calling a functionAnsweryou are telling the computer to run (or execute) that set of actions by
adding the name and () in your code
defining a functionAnswerusing the keyword def to declare the function and follow this up with
the function name. Parameters to the function need to be added, together with the
parentheses and a colon.Defining a function means to teach the computer a new command and
explain what it should do when receiving that command.
what is wrong with this
circle(20)
begin_fill()
end_rill()Answerthe circle should be in the middle
What shape is this? circle(10, 360, 4)Answersquare
What shape is this? circle(10, 360, 3)Answertriangle
for loopAnswerrepeats a set of commands
indentationAnswerThe placement of text farther to the right necessary for the for loop or
functions as a way to show what commands are part of them
setheading(90)AnswerSet the orientation of the turtle to north (up)
seth(0)AnswerSet the orientation of the turtle to East
functionAnswerhelps the code to be reused and to be more organised
calling a functionAnsweryou are telling the computer to run (or execute) that set of actions by
adding the name and () in your code
defining a functionAnswerusing the keyword def to declare the function and follow this up with
the function name. Parameters to the function need to be added, together with the
parentheses and a colon.Defining a function means to teach the computer a new command and
explain what it should do when receiving that command.
what is wrong with this
circle(20)
begin_fill()
end_rill()Answerthe circle should be in the middle
What shape is this? circle(10, 360, 4)Answersquare
What shape is this? circle(10, 360, 3)Answertriangle