Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What will be the value of x after x = 5 and then x += 3?
Think of what `+=` does!
If y starts at 10 and we do y -= 4, what is y now?
Subtract 4 from the starting value.
What does the statement x = 8 do?
Think about what assignment means.
Is y += 5 equivalent to y = y + 5?
Consider how the `+=` operator works.
If you started with a variable b = 50 and used both addition and multiplication assignment operators to reach the value of 101, what steps would you take?
Think of adding a number to 50, then scaling it up.
Create a Python code that uses assignment operators to organize a shopping budget, starting from a total of $100, making repetitive purchases of $10 each until a specified total of $30 (i.e., $100 - $30).
Consider how many purchases you can make.
6 more questions in this section. Enroll free to practise them all.
Enroll free