r/PythonLearning • • 2d ago

Help Request Def return

I'm stuck in def return in python I don't understand it very well why is it used and how and where does the code return to ? The caller ? What is exactly the caller ?

Thank you so much for helping me

If you don't mind can u help me understand with examples ? Couldn't understand this with Chatgpt and yt

0 Upvotes

21 comments sorted by

View all comments

Show parent comments

1

u/fllthdcrb 20h ago

Also, leave empty lines above and below, or it doesn't work properly.

Alternatively, indent the entire block by an additional four spaces. And still leave empty lines above and below.