Several ways to achieve this but this would be an easy way if you are pre Python 3.6:
for i in range(1, 11):
print('IP.Location.{my_number}'.format(my_number=i))
If you have Python 3.6+ then:
for i in range(1, 11):
print(f'IP.Location.{i}')
Finally if you just have the string and you want to increment up from it then extract the int from the string, extract just the non-int bit and use that as your string and range:
location = "IP.Location.1"
initial_number = int(''.join(filter(str.isdigit, location)))
string_phrase = ''.join([i for i in location if not i.isdigit()])
for i in range(initial_number, initial_number + 10):
print(f'{string_phrase}{i}')
"IP.Location.1"as input and create the corresponding string"IP.Location.2"as output, or do you want to take a number like 5 as input and create the corresponding string"IP.Location.5"as output?