LinkedIn Python Skill Assessment Quiz Answers

Why would you use a decorator?

Latest Update on 25th January, 2022 by Certification Course Answers

Why would you use a decorator?

  1.  A decorator is similar to a class and should be used if you are doing functional programming instead of object oriented programming.
  2.  A decorator is a visual indicator to someone reading your code that a portion of your code is critical and should not be changed.
  3.  You use the decorator to alter the functionality of a function without having to modify the functions code.
  4.  An import statement is preceded by a decorator, python knows to import the most recent version of whatever package or library is being imported.

Correct Answer:

  •  You use the decorator to alter the functionality of a function without having to modify the functions code.

Latest Updates

No posts found in this category.