2
Does anyone know how to make the code below work?
Or some alternative that works, but follows the principle.
def f_numbers(number='no'):
if number == 'no':
return 'Você não definiu um número'
else:
return 'Seu número: '+number
def func2(func):
set_number = 2
print(func(set_number))
def func1():
func2(f_numbers())
func1()
My original code is different, but I did this little simulation to make it easy to understand.
Updating:
Remembering that I can only set the parameter of f_numbers
within the function func2
, because this value is defined according to a loop for
which sits within func2
Something so simple to solve rs. I thought in python, a function sent by parameter was only interpreted as a function if it had been passed in parentheses as well. Really this language is amazing, very simple and practical. @Sidon
– Suel