7/29/2016 10:21:34 AM
print only show result, would not change value of x
In your computer memory, x still 7.
it would print the modified value of x
@jimmy and @sunder
my problem is that 1st print(x) prints "enter a no:7"
then 2nd print(x)prints only 7. what is causing it?
May I know why are you assigning the variable to another variable
I am sure it wouldn't return anything
sorry by mistake.. I mean print(x)
enter a no:7
once again this is problem with solo learn environment
if you try in the real python environment it would have worked.
Sololearn have its own limitation since its just a simulated python ide
the statement 'print(x+3)' doesn't increase a value of the variable x, it only outputs the result of adding x to 3. To change the variable you should write x = x+3 (or x += 3, that's the same)
ans 0 and 3
Then it works like the following
enter a number: 7
is this what your desired output?
Send us a message