#the problem is you pass an float argument to randint wich not support that #we should use random.uniform() rand = random.uniform(-0.5,0.5) print(rand)