Variables in Python – Stack Overflow in Spanish

My question is more than anything theoretical. Basically I program in c ++ and start to see some python the problem is that I do not understand when the variable is "deleted" in python. Example

code in c ++
int main (int argc, char * argv[]) {
    int value = 1;
    for (int i = 0; i <1; i ++) {
        int value = 2;
        cout << value << endl;
    cout << value << endl;
    return 0;

that results in console 1 and 2

on the other hand in python the code

value = 1
for k in range (1):
    value = 2
print (value)

It results in 2. I know that the static memory in c ++ is deleted when the for key is closed but in python I do not know how it works. If someone clarifies how memory works in those cases I would appreciate it. regards