Practice Makes Perfect


#1

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)
else:
print "False"


#2

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


#3

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