Asabeneh / 30-Days-Of-Python

30 days of Python programming challenge is a step-by-step guide to learn the Python programming language in 30 days. This challenge may take more than100 days, follow your own pace. These videos may help too: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

In day-11 Error in program execution result

mjz2457784786 opened this issue · comments

commented

#You can pass functions around as parameters def square_number (n): return n * n def do_something(f, x): return f(x) print(do_something(square_number, 3)) # 27
As we can see, The result of running this code above is 9, not 27.

def square_number(n):
return n * n

def do_something(f, x):
return f(x)

print(do_something(square_number, 3))

I
python
ndeed, the output is 9.