Practice Makes Perfect Help


#1



Oops, try again. by_three(1) resulted in an error: unsupported operand type(s) for %: 'function' and 'int'


number=raw_input("type a number:")
def cube(number):
    return number**3
    print number**3
def by_three(number):
    if by_three % 3 == 0:
        print "The number is Divizible"
        return cube(number)
    else:
        print "Nope"
        return False


#2

Here, you call the function rather than the argument inside it's parameter. Which is why the error says it can't find the remainder of a function. Switching 'by_three' with 'number' should solve the problem.

Hope this helps! If not, feel free to reply and I'll try to go more in-depth.


#3

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