python var mem | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

python var mem

Python Variables If we declare a variable in python like a=10 And later in the code if we declare change that as a=20 What will happen to the memory which is having 10

25th Jul 2018, 4:12 PM
David Paul
David Paul - avatar
2 Answers
+ 3
It looks the same as this question: https://www.sololearn.com/Discuss/1422070/?ref=app
25th Jul 2018, 6:40 PM
Paul
Paul - avatar
+ 2
it is just replaced with 20 but it was 10 before you declared it as 20 so you could do print(a) and it will output 10 but when it is declared as 20 and you printed it it’ll output and 20
25th Jul 2018, 4:33 PM
Nicolass22
Nicolass22 - avatar