import random from sprites import constrain x = random.randint(-1000,1000) print(x) x = constrain(x,-300,300) print(x)