From dd20f84f726f3d1df42ca26202bd9601b28d4ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Ot=C3=A1vio?= Date: Tue, 1 Nov 2022 12:14:59 -0300 Subject: [PATCH] =?UTF-8?q?Higher=20Order=20Functions=20-=20Fun=C3=A7?= =?UTF-8?q?=C3=B5es=20de=20primeira=20classe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aula73.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 aula73.py diff --git a/aula73.py b/aula73.py new file mode 100644 index 0000000..fa5a68c --- /dev/null +++ b/aula73.py @@ -0,0 +1,20 @@ +""" +Higher Order Functions +Funções de primeira classe +""" + + +def saudacao(msg, nome): + return f'{msg}, {nome}!' + + +def executa(funcao, *args): + return funcao(*args) + + +print( + executa(saudacao, 'Bom dia', 'Luiz') +) +print( + executa(saudacao, 'Boa noite', 'Maria') +)