Stuck on Parameters and Arguments


#1

def power(37, 4):  # Add your parameters here!
    result = base**exponent
    print "%d to the power of %d is %d." % (base, exponent, result)

power(37,4)  # Add your arguments here!

plz tell me what is wrong?


#2

when declaring the function:

def power(37, 4):  # Add your parameters here!

you want your parameters to have a name (in this case base and exponent) (not 37 and 4), so that you can call the function:

power(37,4)

with many different arguments, and not have to rewrite it the entire time.


#3

thank you very much.love you guy:)


#4

My is not working, plz help


#5

I am refusing to answer this since this the exact same problem as already resolved in this topic


#6

A post was split to a new topic: Parameters and arguments