Returning values


#1

https://www.codecademy.com/courses/python-beginner-c7VZg/1/5?curriculum_id=4f89dab3d788890003000096#

It returns none. The error message from the interface is "Oops, try again. by_three(3) returned None, did you remember to return the result?"

Can someone help me understand what values the question wants me to return?


def cube(number):
    return number**3
    
def by_three(number):
    if number%3==0:
        a=cube(number)
        print a
    else: 
        return False


#2

There, you should return a

return a

#3

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