I have code like this:
loopcount = 3
for i in range(1, loopcount)
somestring = \'7\'
newcount = int(somestring)
loopcount = newcount
The while-loop answer given by user802500 is likely to be the best solution to your actual problem; however, I think the question as asked has an interesting and instructive answer.
The result of the range() call is a list of consecutive values. The for-loop iterates over that list until it is exhausted.
Here is the key point: You are allowed to mutate the list during iteration.
>>> loopcount = 3
>>> r = range(1, loopcount)
>>> for i in r:
somestring = '7'
newcount = int(somestring)
del r[newcount:]
A practical use of this feature is iterating over tasks in a todo list and allowing some tasks to generate new todos:
for task in tasklist:
newtask = do(task)
if newtask:
tasklist.append(newtask)