Parameters and arguments problem


#1

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

def power(37, 4): # Add your arguments here!
result = base**exponent
print "%d to the power of %d is %d" % (base, exponent, result)
I do not see the problem!
please help!
Error message says "Did you remember to put a comma between your parameters and arguments?"


#2

Can be reduced to this...

power(37, 4)

These lines are not needed. They are not the same variables in the parameter list. Both have different scope. You could write,

base = 37
exponent = 4
power(base, exponent)

The arguments are those variables, not the ones inside the function which are locally defined.


#3

Base = 37
Power = 4

def power(Base, Power): # Add your parameters here!
Result = Base**Power
print "%d to the power of %d is %d." % (Base, Power, Result)

def power(Base, Power):
Result = Base**Power
print "%d to the power of %d is %d." % (Base, Power, Result)

any ideas?