Https://www.codecademy.com/paths/data-science/tracks/dspath-functions-and-logic/modules/dspath-python-functions/articles/python-code-challenges-functions

https://www.codecademy.com/paths/data-science/tracks/dspath-functions-and-logic/modules/dspath-python-functions/articles/python-code-challenges-functions

Perhaps I’m just tired but when this challenge says:

" Write a function named tenth_power() that has one parameter named num .
The function should return num raised to the 10th power."

It should be:
def tenth_power(num)
return num ** 10

correct??

I keep getting this error:

Write your tenth_power function here:

def tenth_power(num)
return num ** 10

Uncomment these function calls to test your tenth_power function:

print(tenth_power(1))

1 to the 10th power is 1

#print(tenth_power(0))

0 to the 10th power is 0

#print(tenth_power(2))

Output:
File “script.py”, line 2
def tenth_power(num)
^
SyntaxError: invalid syntax

Can anyone help me understand where I’m interpreting this wrong?

Thanks!

Hello! Should there be a colon at the end of the def tenth_power(num) line? It seems you’ve left it off. Also, maybe check the indentation.

2 Likes

Here’s a good explanation of indentation & python:
https://www.geeksforgeeks.org/indentation-in-python/

I knew I should have went to bed…

Thanks!

1 Like

Thanks Lisa!

It was as I thought - time for bed haha!

1 Like