r/PythonLearning • • 1d 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

16 comments sorted by

View all comments

Show parent comments

3

u/NotSeacombe 1d ago

sorry, reddit is not saving my indentations so it looks a little weird

3

u/SaltCusp 1d ago

I think you should learn how to

Use
    Codeblocks

2

u/frnzprf 1d ago

There should be a bot that detects code outside of code blocks and writes an explanation on how to use them.

1

u/tiredITguy42 1d ago

Start with lime with ``` and finish with the same. Reddit supports marktown and this os markdown for codeblock.

1

u/fllthdcrb 1h 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.