Unable to understand the program


#1

this was my program unable to execute the same kindly assist the same …

def power(_base__, exponent___):
  # 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!

this was the error showing while executing in the console window
Traceback (most recent call last):
File “python”, line 5, in
File “python”, line 2, in power
NameError: global name ‘base’ is not defined


#2

here:

def power(_base__, exponent___):

why do you have underscores around the parameters?


#3

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