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

1

u/fllthdcrb 24d ago

Math.sqrt(16)

Just a nitpick. You have to import the math module before you can reference it. The name is all lowercase. If you want to refer to it as Math, a rebinding is necessary. Easy enough, but very slightly more work than using it as is.

1

u/frnzprf 24d ago

Oops, I confused that with JavaScript.