I am just experimenting with some things in python, and one of my problems required a funny solution of changing a /
to a //
. What's the difference?
def is_multiple(number=None, m=None): # m representing times table
if not number or not m:
return False
if isinstance(m//number, float):
return False
return True
print(is_multiple(4, 12)) # returns True
def is_multiple(number=None, m=None): # m representing times table
if not number or not m:
return False
if isinstance(m/number, float):
return False
return True
print(is_multiple(4, 12)) # returns False
I would expect both to work the same, can someone explain the difference? Thanks :)