Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge: Basic Smores Recipe | Decorators
Intermediate Python: Arguments, Scopes and Decorators
course content

Contenido del Curso

Intermediate Python: Arguments, Scopes and Decorators

Intermediate Python: Arguments, Scopes and Decorators

1. Packing and Unpacking
2. Arguments in Function
3. Function as an Argument
4. Variable Scope
5. Decorators

Challenge: Basic Smores Recipe

Tarea

When you run this script, it should output the layers of a smore in the correct order: cracker, chocolate, marshmallow, cracker.

This exercise demonstrates the concept of how decorators wrap functionality around a function in Python.

  1. In the wrapper function of the crackers decorator, you need to call the function being decorated (i.e., func). This should be done between the two print statements;
  2. Ensure that the function func is called with any arguments and keyword arguments it might receive;
  3. Similar to the crackers decorator, the chocolate decorator should call the function it's decorating.
  4. The main task is to put decorators in right sequence. You must receive:

Tarea

When you run this script, it should output the layers of a smore in the correct order: cracker, chocolate, marshmallow, cracker.

This exercise demonstrates the concept of how decorators wrap functionality around a function in Python.

  1. In the wrapper function of the crackers decorator, you need to call the function being decorated (i.e., func). This should be done between the two print statements;
  2. Ensure that the function func is called with any arguments and keyword arguments it might receive;
  3. Similar to the crackers decorator, the chocolate decorator should call the function it's decorating.
  4. The main task is to put decorators in right sequence. You must receive:

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones

¿Todo estuvo claro?

Sección 5. Capítulo 6
toggle bottom row

Challenge: Basic Smores Recipe

Tarea

When you run this script, it should output the layers of a smore in the correct order: cracker, chocolate, marshmallow, cracker.

This exercise demonstrates the concept of how decorators wrap functionality around a function in Python.

  1. In the wrapper function of the crackers decorator, you need to call the function being decorated (i.e., func). This should be done between the two print statements;
  2. Ensure that the function func is called with any arguments and keyword arguments it might receive;
  3. Similar to the crackers decorator, the chocolate decorator should call the function it's decorating.
  4. The main task is to put decorators in right sequence. You must receive:

Tarea

When you run this script, it should output the layers of a smore in the correct order: cracker, chocolate, marshmallow, cracker.

This exercise demonstrates the concept of how decorators wrap functionality around a function in Python.

  1. In the wrapper function of the crackers decorator, you need to call the function being decorated (i.e., func). This should be done between the two print statements;
  2. Ensure that the function func is called with any arguments and keyword arguments it might receive;
  3. Similar to the crackers decorator, the chocolate decorator should call the function it's decorating.
  4. The main task is to put decorators in right sequence. You must receive:

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones

¿Todo estuvo claro?

Sección 5. Capítulo 6
toggle bottom row

Challenge: Basic Smores Recipe

Tarea

When you run this script, it should output the layers of a smore in the correct order: cracker, chocolate, marshmallow, cracker.

This exercise demonstrates the concept of how decorators wrap functionality around a function in Python.

  1. In the wrapper function of the crackers decorator, you need to call the function being decorated (i.e., func). This should be done between the two print statements;
  2. Ensure that the function func is called with any arguments and keyword arguments it might receive;
  3. Similar to the crackers decorator, the chocolate decorator should call the function it's decorating.
  4. The main task is to put decorators in right sequence. You must receive:

Tarea

When you run this script, it should output the layers of a smore in the correct order: cracker, chocolate, marshmallow, cracker.

This exercise demonstrates the concept of how decorators wrap functionality around a function in Python.

  1. In the wrapper function of the crackers decorator, you need to call the function being decorated (i.e., func). This should be done between the two print statements;
  2. Ensure that the function func is called with any arguments and keyword arguments it might receive;
  3. Similar to the crackers decorator, the chocolate decorator should call the function it's decorating.
  4. The main task is to put decorators in right sequence. You must receive:

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones

¿Todo estuvo claro?

Tarea

When you run this script, it should output the layers of a smore in the correct order: cracker, chocolate, marshmallow, cracker.

This exercise demonstrates the concept of how decorators wrap functionality around a function in Python.

  1. In the wrapper function of the crackers decorator, you need to call the function being decorated (i.e., func). This should be done between the two print statements;
  2. Ensure that the function func is called with any arguments and keyword arguments it might receive;
  3. Similar to the crackers decorator, the chocolate decorator should call the function it's decorating.
  4. The main task is to put decorators in right sequence. You must receive:

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
Sección 5. Capítulo 6
Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
We're sorry to hear that something went wrong. What happened?
some-alt