Sep-28-2018, 02:25 AM
Write the definition of a function powerTo which recieves two parameters, a double and an integer. If the second parameter is positive, the function returns the value of the first parameter raised to the power of the second. Otherwise, the function returns 0.
My code:
def powerTo(double, int):
if int>=0
return double**int
else:
return 0
any idea why its not working?
My code:
def powerTo(double, int):
if int>=0
return double**int
else:
return 0
any idea why its not working?