+ 1
How datas are stored?can anyome explain how it works.. i got output as 100.. but i expected 1
a=100 b=a b=1 print(a)
2 ответов
+ 4
in this case you assign the value of 100 to a variable 'a'.
then you assign the value of 'a' (100) to the variable 'b'
at this stage both a and b equal 100.
then you assign 1 to b
so now:
a = 100 #you haven't changed the value of 'a'
b = 1 # you first made it 100 and then changed it to 1.
you then print the value of 'a' which is 100.
variable on the left, value bring assigned in the right.
Hope that helps!
+ 2
always in equality expressions :
destination var= argument vars
so what would You suppose to achieve in such expression:
{x=a+b+c;}
{a+b+c=x;} is the same as {a+b+x;}
VALUE = ARGUMENT
i.e.
F(x)=ax+b;