You are searching for a number with more than 500 divisors in the range 0 to 10000. But we are not sure whether a number less than 10000 will be the required number. So, instead of searching a number in a range, we can search for that number which satisfies the condition the in the set of positive real numbers.
num=1
tnum=0 #representing triangular number
nof=0
while nof<501:
nof=2 #to include 1 and the number itself
tnum+=num
num+=1
for i in range (2,int((tnum/2))+1):
if tnum%i==0:
nof+=1
print (tnum," : ",nof) #printing the triangular number and its number of divisors
print ("Required number is ", tnum)
This code will also take a good amount of time to get you result.