Please help!


#1

Can someone please help!!
print 'Welcome to the Pig Latin Translator!'

Start coding here!

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

power(,) # Add your arguments here!


#2

You can't:

print "%d to the power of %d is %d." % (base, exponent, result)

You have to assign that to a variable, then print the variable.

EDIT: Also, you dont want to put the numbers in as arguments when you define the function, you should put placeholder variables there, such as base and exponent, which will then pass them to the various calls inside the funciton.


#3

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