• 6 hours
  • Easy

Free online content available in this course.



Got it!

Last updated on 2/18/22

Write functions in Python

Log in or subscribe for free to enjoy all this course has to offer!

Evaluated skills

  • Write functions in Python
  • Question 1

    Which of the following statements are true regarding parameters and return values of a function?

    Careful, there are several correct answers.
    • Parameters of a function are variables defined inside a method signature as being necessary input for performing a task.

    • Arguments are values sent to a method.

    • Return values are the output, or in other words, the result a function needs to return.

    • Parameters and return values are mandatory in functions.

  • Question 2

    Check out the following code snippet:

    What will be the values of the variables  x  and  y  by the end of the execution?

    • x -> 1, y -> 10

    • x -> 22, y -> 64

    • x -> 64, y -> 22

    • x -> 1, y -> 64

  • Question 3

    Which of the following statements is true?

    • Functions are used to create objects in Python.

    • Functions make your program run faster.

    • A function is a piece of code that performs a specific task.

    • All of the above.