Can anyone help me with this question? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can anyone help me with this question?

X = 4 X = 5 Print

26th Apr 2018, 6:45 PM
Amy Quinn
Amy Quinn - avatar
2 Answers
+ 1
I haven't done python yet but I think the variable "X" will get over written because first X=4 then X gets new value which is X=5 so the up-to-date value for "X" is 5 and the ooutput should be 5
26th Apr 2018, 9:51 PM
[No Name]
[No Name] - avatar
+ 2
A variable is work as a storing place of data. First variable X stored its value as 4. When X takes new value 5 then Old value of variable X (here 4) is wiped out and new value 5 is stored . So when we command print(x) then it shows its value 5 as output.
26th Apr 2018, 7:16 PM
📈SmileGoodHope📈
📈SmileGoodHope📈 - avatar