Help I just don't know what went wrong!


#1



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


This popped up Oops, try again. by_three(2) returned True instead of False


I expected Success


def cube(number):
    return number**3

def by_three(number):
    if 3 % number:
        return True
    else: 
        return False


#2

your if condition is wrong, if the remainder of number divided by three is zero you should return the cube of the number

your if condition checks if the remainder of 3 divided by number. not really logic.


#3

Firstly, you can check the code system on the hint how the dividing 3 is done. Then, you should correct first return of by_three. Secondly , you check again on fourth instroduction. Then it will be done.


#4

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