Help. something is wrong


#1

whats wrong with this code. im on functions.
"""number = 81
def cube(number):
number = number ** 3
return number

def by_three(number):
if number % 3 == 27:
return 81 % 3
else:
return False


#2

why do you have this at the beginning?


#3

number % 3 == 27 // pay attention how to use %

81 % 3 == 0 means if 81 is divisible by 3

actually, the answer of the expression of 81%3 is 0.

i can give you more example then you can understand the difference between % and /
3 % 2 ==1 ; 3.0 / 2 == 1.5
3 % 3 ==0 ; 3.0 / 3 == 1.0


#4

the problem is if i set it to a value itll say to do another value, but if i do that value, itll say to do the 1st


#5

Can you post the link to exercise.


#6

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