+ 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)

27th Aug 2020, 11:04 AM
victor bamidele
victor bamidele - avatar
12 Respostas
+ 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"
27th Aug 2020, 11:10 AM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
0
Yeah man I correct that still the same error
27th Aug 2020, 11:12 AM
victor bamidele
victor bamidele - avatar
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
27th Aug 2020, 11:13 AM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
0
Which function the return function right yeah
27th Aug 2020, 11:15 AM
victor bamidele
victor bamidele - avatar
0
I got the same error
27th Aug 2020, 11:15 AM
victor bamidele
victor bamidele - avatar
0
Just type the correct code
27th Aug 2020, 11:16 AM
victor bamidele
victor bamidele - avatar
0
I would explain this code for you, but next time make sure you understand them https://code.sololearn.com/cf0FMPNBcaGk/?ref=app
27th Aug 2020, 11:18 AM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
0
I got invalid syntax error
27th Aug 2020, 11:18 AM
victor bamidele
victor bamidele - avatar
0
Thank I got it now python actually need arrangements for code to run
27th Aug 2020, 11:26 AM
victor bamidele
victor bamidele - avatar
0
victor bamidele i updated the Code with some explanation in it
27th Aug 2020, 11:26 AM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
0
Got it
27th Aug 2020, 11:27 AM
victor bamidele
victor bamidele - avatar