0
Can some one help me with moduel 1 quiz q4
3 ответов
+ 3
OK the question is:
Fill in the blanks to declare a variable, add 5 to it and print its value.
>>> x = 4
>>> x _= 5
>>> print___
They did the first part for you: the variable x is declared with a value of 4.
Now you have to add 5 to the variable. Because there is a blank before the = sign, it looks like they want you to use the in place operator +=. Remember x += 5 is a short way of writing x = x + 5.
So the first blank is +.
Then you have to print the result, so the command is print(x), i.e. the second blank is (x). Don't forget the () (required in Python 3).
Aside: the last two lines could have been combined by simply using print(x + 5).
+ 2
>>> x += 5
>>> print(x)
+ 1
post your question here