+ 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 Answers
+ 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.