+ 1
Hi guy been playing with some code in python I always have this error return outside function
Here the code print ('hacking course') def guy (x, y, z) goo=x**y-z print(goo) Return goo Guy (6,7,8)
12 Respuestas
+ 1
Great, sounds good you started learning..
Python works on indentation,
U need to add spaces before the statements which belong to a single block
And python is also case sensitive so "Return" is wrong it should be " return"
and the funcion call "Guy(6,7,8)"
Should also be same as the function name, which is "guy"
0
Yeah man I correct that still the same error
0
In addition to it you missed colon after the function,
And since you are printing and returning the function, so you should be aware what those two statements do..
When to use print () and when to return from a function
0
Which function the return function right yeah
0
I got the same error
0
Just type the correct code
0
I would explain this code for you, but next time make sure you understand them
https://code.sololearn.com/cf0FMPNBcaGk/?ref=app
0
I got invalid syntax error
0
Thank I got it now python actually need arrangements for code to run
0
victor bamidele i updated the Code with some explanation in it
0
Got it