+ 2
what‘s the meaning of this?
fill in the blanks to declare a variable,add 5 to it and print its value I have got stuck for a long time
4 odpowiedzi
+ 1
x = 4
x += 5
print(x)
+ 1
So, this is basically saying create a variable, add five to it, and print the value.
Think of a variable like a container for data, so lets say... money, right? Let's say money holds the value 0, because someone is poor. So, what you would type is:
money = 0
Then to add five, you could either do:
money = money + 5 (this is reassigning the variable with a new value)
or:
money += 5 (this is the same as above, but just typed differently)
Hope this helps! 👍
+ 1
Thank you!
0
Well,ty.I know ‘money +=5’ but how can I print the valve:
>>>x=4
>>>x+=5
>>>print ()
I’ve tried to enter ‘print (“9”)’ or ‘print (9)’,but it’s all wrong.