Python has an interesting feature called decorators to add functionality to an existing code.

This is also called metaprogramming because a part of the program tries to modify another part of the program at compile time.

There are three rules of functions:

  1. Reference of a function to another function
  2. A…