+ 1
Well this one is confusing ..like hello() was already defined above ..but why error?
https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2285/
3 Antworten
+ 4
Daya
The reason for the error, was that the hello() function was called before it's definition.
It was like trying to use a variable you hadn't created.
+ 3
You can't call a function before it is defined.
Something like this happens.
It goes to the first line which says hello(), it goes to its memory to run the function hello, but as there is no hello function already defined in memory, it gives you an error and stops.
Remember, Python is an interpreted language and runs top to bottom.
+ 2
for create a function
def fun()
print('hi')
for use a function when not return any value.
fun()
if function return any value then use it like.
print(fun())