Given Python code, fix the bug.
def my_function(n):
    while n > 1000 :
        n = n/10
    return n

n = 2000
print(my_function(n))
def my_function(n):
    while n > 1000 :
        n = n//10
    return n

n = 2000
print(my_function(n))