Printable worksheet ยท 4 of 4

Assignment changes stored state - Paper 4

Read the information, then answer the questions. An adult may read the instructions aloud. Show your working where asked.

Read before answering

Trace these Python statements in order: score = 9; score = score + 2; saved = score; score = score * 3; same = (score == saved). Semicolons separate statements. = assigns after evaluating the right side; == tests equality. These values are immutable integers, so later reassignment of score does not change saved.

Worksheet preview

This exercise is included in the paid course. Full-course fee: GBP 200.00 once. Register and enrol to complete all course exercises and download the course PDFs. Access begins after payment is confirmed.

Register and enrol

Already registered? Sign in