i want to produce random ranges with specific range of sizes between two numbers. first i thought there might be some specific functions in random module to do that , but it seems that there is not such function.
i wrote the following code but its slow.
import random
range_list=[]
n=0
while n<1000000:
first=random.randint(1,3000000000)
last=random.randint(1,3000000000)
if abs(last-first) <150 and abs(last-first)>100:
range_list.append([last,first])
else:
continue
n+=1
is there any fast way to do this?