Practice Makes Perfect help


#1


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

by_three(1) returned 1 instead of False
I dont understand what i am doing wrong please help


Replace this line with your code. 
def cube(number):
    return number**3
    
def by_three(number):
    if number %3:
        
        return cube(number)
        
    else:
    
        return False


#2

When this is non-zero, it will be true in the if condition, but number is not divisible by 3. Switch your two return statements around and it will work correctly..


#3

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