Another answer producing integers, much faster at that than my other answer and the OP's string solution:
>>> a = 12345
>>> digits = [0] + list(map(int, str(a)))
>>> p = 10**(len(digits) - 2)
>>> for x, y in zip(digits, digits[1:]):
a += (x - y) * p
p //= 10
print(a)
2345
1345
1245
1235
1234
This goes from 2345 to 1345 by replacing the 2 with the 1, which it does by subtracting 2⋅1000 and adding 1⋅1000. Or in short, by adding (1-2)⋅1000. Then it goes from 1345 to 1245 by adding (2-3)⋅100. And so on.
Benchmark results, using a modified version of Eugene's program:
digits str1 str2 int1 int2
101 0.085 0.255 0.376 0.157
201 0.161 0.943 1.569 0.389
501 0.514 9.180 9.932 0.983
1001 0.699 30.544 39.796 2.218
2001 1.402 203.429 291.006 8.435
5001 4.852 2691.292 3983.420 50.616
10002 16.080 21139.318 29114.274 197.343
20001 54.884 167641.593 222848.841 789.182
str1 is the time for the OP's string solution, producing strings.
str2 is the time for the OP's string solution, turning the strings into ints.
int1 is my other solution producing ints.
int2 is my new solution producing ints.
No surprise that the OP's string solution is the fastest overall. Its runtime complexity is quadratic in the number of digits. Which is the total output size, so that's optimal. My new solution is quadratic as well, but doing calculations is of course more work than pure copying.
For producing ints, my new solution is by far the fastest. My old one and the OP's have cubic runtime for that (with the OP's apparently being around 1.4 times as fast as my old one).
The benchmark program (modified version of Eugene's):
import timeit, math
digits = [100, 200, 500, 1_000, 2_000, 5_000, 10_000, 20_000]
def print_str_1(n):
s = str(n)
for i in range(len(s)):
#print(i)
n2 = s[:i] + s[i+1:]
def print_str_2(n):
s = str(n)
for i in range(len(s)):
#print(i)
n2 = int(s[:i] + s[i+1:])
def print_int_1(a):
p = 1
while p <= a:
n2 = a//p//10*p + a%p
p *= 10
def print_int_2(a):
digits = [0] + list(map(int, str(a)))
p = 10**(len(digits) - 2)
for x, y in zip(digits, digits[1:]):
a += (x - y) * p
p //= 10
#print(a)
if __name__ == '__main__':
print(("{:>6}" + 4 * "{:>12}").format('digits', 'str1', 'str2', 'int1', 'int2'))
number = 1
for i in digits:
n = 17**math.ceil(math.log(10**i, 17))
str1 = timeit.timeit('print_str_1(n)', setup='from __main__ import print_str_1, n', number=number)
str2 = timeit.timeit('print_str_2(n)', setup='from __main__ import print_str_2, n', number=number)
int1 = timeit.timeit('print_int_1(n)', setup='from __main__ import print_int_1, n', number=number)
int2 = timeit.timeit('print_int_2(n)', setup='from __main__ import print_int_2, n', number=number)
print(("{:6d}" + 4 * "{:12.3f}").format(len(str(n)), *(x/number*1000 for x in (str1, str2, int1, int2))))