How's this wrong"practice makes perfect"


#1



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


Oops, try again. by_three(3) returned None, did you remember to return the result?


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


#2

here:

    if number%3==0:
        print cube(number)

if number is divisible by 3 you print the result, you don't return it.


#3

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