Could somebody explain parameters and arguments to me?


#1

This may sound dumb, but hear me out. I'm just starting to get into Python and so far, my biggest stump is that I literally don't understand what parameters and arguments are for. Like what do they do, why do we even need them etc? I don't know, I really wish somebody could help me out.


#2

you don't understand how they work or don't understand how they work, look:

def add(x, y):
    return x + y

print add(5,4)
print add(3,2)
print add(11,14)

see how i i use function, parameters and arguments to do reparative task? very useful.


#3

Riiight, now I've got it! Thank you so much, you saved me from a bunch of headache.

Have a good one!


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.