When defining a function, which keyword do we use?, Programming Essentials help

User Generated

Anarggr

Programming

Description

Question 1

  1.  

    When defining a function, which keyword do we use:

    define

    def

    function

    func

1 points  

Question 2

  1.  

    We _________ the lines of code that belong to the body of a function so the interpreter understand what makes up the body of the function.

    bold

    place curly braces around

    indent

    number

1 points  

Question 3

  1.  

    The “return” keyword is:

    used to stop the function and return to the calling function.

    required to end all function definitions.

    create a new line on the screen output.

    return a value from the function, back to the calling function.

1 points  

Question 4

  1.  

    When defining a function, we declare a(n) ________  in parenthesis , so that we can pass data into the function for processing.

    Parameter

    Argument

    Identifier

    Pointer

1 points  

Question 5

  1.  

    If we declare a variable called ‘name’ inside of a function while there is a global variable with the same name, which variable is referenced from inside of the function in the following command: print(name)?

    The global variable

    The local variable

    You cannot have multiple variables with the same name, regardless of scope.

    you have to specify with a leading command

1 points  

Question 6

  1.  

    When condtructing a function, which is NOT a minimum requirement:

    unique identifier

    the def keyword

    a parameter list

    return command

1 points  

Question 7

  1.  

    It is a best practice to define functions that perform as many operations as possible.

1 points  

Question 8

  1.  

    When you define a variable inside of a function, that variable can be seen:

    By commands inside of the function only.

    By commands in global space.

    By commands in other functions.

    By commands in other functions called by the function in question.

1 points  

Question 9

  1.  

    When we say that a variable defined in a function can only be seen by commands inside of that same function, the variable is limited by _____________.

    Run-time

    Scope

    Size

    Definition

1 points  

Question 10

  1.  

    Python defines scope using:

    Curly braces { }

    Square brackets [ ]

    The keywords start and end

    Indentation


User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer


Anonymous
Really great stuff, couldn't ask for more.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags