I was doing this exercise and wrote my code, but unfortunately there seems to be a mistake in my code. Could someone please help me see what’s the problem with it: I made sure all the indentations are correct.Thanks
def cube(n):
return n**3
def by_three(n):
if n % 3 == 0:
return cube(n)
else:
print("False")
Thanks for the response. The excercice is called “Practice makes Perfect”. It basically just tries to teach how to call a function within another one.
The error says: by_three(1) resulted none.