assign value from firt loop in for loop to variable python code example Example: how to add to a variable in a for loop n = 5 while n > 0: print n n = n-1 print 'Blastoff!'