Practice Makes Perfect


Can't figure out what is wrong with my code. It always shows up as none.

def cube(number):
return number ** 3

def by_three(number):
if number % 3 == 0:
print cube(number)
print "False"


None is the value the console sees when there is no return statement, or no return value. Change print to return.


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