我的 if/else 语句有问题。这是我的代码,该问题在代码本身的多行注释中进行了描述:
def cube(*number):
return number**3
def by_three(number):
if number/3==0: #Checks if number is divisible by 3.
cube_of=cube(number) #Cubes number.
print(cube_of) #Prints cube of number.
return False
else:
print("Your number isn't divisible by three. Try again.") #Comment is below
"""
Tells if number is not divisible by three. If I give 9 as the argument,
this block is executed. Why so?
"""
return True
while True:
by_three(int(input("Give me any number divisible by three: ")))
问题在代码中。请在您的答案中使用简单的术语,因为我只是一个初学者。