If we add variable x=2 in python and later assign x=3 after that if I write print(x+4) which value will x take | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

If we add variable x=2 in python and later assign x=3 after that if I write print(x+4) which value will x take

23rd Oct 2020, 3:17 AM
Ujjwal Sharma
4 Answers
+ 1
If you will reassign any value with same Variable Like this a=20 Then again a=40 then it will print new value 40 not 20
23rd Oct 2020, 5:04 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 3
What do you think? 7 or 6 EDIT: yes, that's correct Ujjwal Sharma. Assignment is supposed to change a variable's value.
23rd Oct 2020, 3:25 AM
777
777 - avatar
+ 1
I think 7 what is the correct answer
23rd Oct 2020, 3:26 AM
Ujjwal Sharma
0
If it simply use latest value then why we need del command please help
23rd Oct 2020, 3:33 AM
Ujjwal Sharma