Last active
August 29, 2015 14:10
-
-
Save renzon/6156ba239c70578110ea to your computer and use it in GitHub Desktop.
Função como Parâmetro de outra
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def executador_de_funcao(fcn): | |
return fcn() | |
def a(): | |
return 'A' | |
def b(): | |
return 'B' | |
print(executador_de_funcao(a)) # Imprime A | |
print(executador_de_funcao(b)) # Imprime B |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment