Computers

9th -

12thgrade

Image

codehs: Unit 2 Lessons 13 to 19

125
plays

15 questions

Show Answers
See Preview
  • 1. Multiple Choice
    3 minutes
    1 pt

    Why are parameters useful?

    They allow us to tailor functions to be used in multiple situations

    They allow us to change the order of commands in a function

    They give us the ability to use variables in loops

    They allow the user to give input

  • 2. Multiple Choice
    3 minutes
    1 pt

    How many parameters can we use in each function?

    1

    2

    4

    As many as we need

  • 3. Multiple Choice
    3 minutes
    1 pt

    What is the best way to write a program that uses parameters to draw a square with sides that are 50 pixels long?

    def make_square(length):

    for i in range(4):

    forward(length)

    left(90)


    make_square(50)

    def make_square(length):

    for i in range(4):

    forward(50)

    left(90)


    make_square(50)

    def make_square(50):

    for i in range(4):

    forward(50)

    left(90)


    make_square(50)

    def make_square(length):

    for i in range(4):

    forward(length)

    left(90)


    make_square(length)

  • Answer choices
    Tags
    Answer choices
    Tags

    Explore all questions with a free account

    Already have an account?