Says bythree is not defined, Please help


#1

def cube(number):
return number ** 3

if by_three(n) / 3:
   return cube(number)
else:
    return False

by_three(number)


#2

you should create a function named by_three, creating a function requires the def keyword, look at how you created cube function


#3

def cube(number):
return number ** 3

def by_three(number):
if number / 3:
return cube
else:
return False
what do I return the first time in by three


#4

better, but you need to return the cube() of number is number is divisible by 3, to determine a number is divisble by three, you can check if the remainder equals zero, we can calculate the remainder using the modulo operator


#5

what do you put for the argument of cube
def cube(number):
return number ** 3

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

cube()


#6

bro whats ur function number on so that i can help you


#7

I don't think I have one


#13

number, given you want to return the cube of number

to check if a number is divisble by three, the remainder must equal to zero


#14

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