Not sure about the question if is actually about memory consumption and an algorithm to make it more efficient or if it's tied to a specific language and how it does things in the background.
If it's about memory consumption and an algorithm to improve the solution a good workaround is to use a recursive (or iterative) solution with some simple conditionals.
Example instead of going through the 100 numbers in your loop (im not a python dev so ill write this easy solution in javascript that can be easily tested in chrome's console) you can try something like this:
var iteration = 0;
var odd = function(val,max){
iteration++;
//base case
if ( val > max ) return;
if ( val % 2 == 1 ){
console.log(val);
odd(val+2,max);
}else odd(val+1,max);
}
odd(0,100);
console.log("Total iterations: "+iteration);
It results in only going through 52 iterations instead the 100.