python - Concatenate numbers to URL in increasing order -


i want concatenate numbers in increasing order upto x in url. using:-

i=143  baseurl = 'https://example.com/listproduct/index/21/' + str(i)  while (i>0):     i-=1     print(baseurl) 

instead of getting urls different end numbers, getting same i=143. proper way write above?

baseurl = 'https://example.com/listproduct/index/21/'  while (i>0):    i-=1    print(baseurl  + str(i)) 

Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -