Q:

Python how to add number to string

i want to add numbers in my url
to look like this : 
www.exemple.com/001
www.exemple.com/002
 ...
www.exemple.com/009
www.exemple.com/010
...
www.exemple.com/100
www.exemple.com/101
so i create this script in python
 url = 'www.exemple.com/'
 for x in my_range(0, 10, 1):
    if y<10:
     y='00'+y
    elif y<100:
     y='0'+y
    else:
     pass
  url+=str(y)
  print url 

but i have this error :
 IndentationError: unindent does not match any outer indentation level

any ideas ho to fix this and thanks a lot guys.

A:

If I understand your question, I think you wanted something like
url = 'www.exemple.com/'           # <-- For example
for x in xrange(1, 11, 1):
  print url + "{0:03d}".format(x)

Which stops at 10 and outputs
www.exemple.com/001
www.exemple.com/002
www.exemple.com/003
www.exemple.com/004
www.exemple.com/005
www.exemple.com/006
www.exemple.com/007
www.exemple.com/008
www.exemple.com/009
www.exemple.com/010

