• 6 heures
  • Facile

Ce cours est visible gratuitement en ligne.

course.header.alt.is_video

course.header.alt.is_certifying

J'ai tout compris !

Mis à jour le 21/01/2021

Write functions in Python

Connectez-vous ou inscrivez-vous gratuitement pour bénéficier de toutes les fonctionnalités de ce cours !

Compétences évaluées

  • Write functions in Python
  • Question 1

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

    Attention, plusieurs réponses sont possibles.
    • 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.