Conteúdo do Curso
Intermediate Python Techniques
Intermediate Python Techniques
2. Arguments in Function
3. Function as an Argument
Challenge: Basic Smores Recipe
Tarefa
Swipe to show code editor
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.
- 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; - Ensure that the function func is called with any arguments and keyword arguments it might receive;
- Similar to the crackers decorator, the chocolate decorator should call the function it's decorating.
- The main task is to put decorators in right sequence. You must receive:
Solução
Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 5. Capítulo 6
Challenge: Basic Smores Recipe
Tarefa
Swipe to show code editor
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.
- 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; - Ensure that the function func is called with any arguments and keyword arguments it might receive;
- Similar to the crackers decorator, the chocolate decorator should call the function it's decorating.
- The main task is to put decorators in right sequence. You must receive:
Solução
Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 5. Capítulo 6
Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo