Function Errors: What's wrong with my operand type?


Oops, try again. by_three(1) resulted in an error: unsupported operand type(s) for %: 'function' and 'int'

First, def a function called cube that takes an argument called number. Don't forget the parentheses and the colon!
Make that function return the cube of that number (i.e. that number multiplied by itself and multiplied by itself once again).
Define a second function called by_three that takes an argument called number.
if that number is divisible by 3, by_three should call cube(number) and return its result. Otherwise, by_three should return False.
Don't forget that if and else statements need a : at the end of that line!

Replace this line with your code.


Maybe you should actually "replace this line with your code"?
The link only leads to your own solution of the lesson, so I, for instance, am only able to see my code


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