Prevent replacement collisions

A Python file contains this complete snippet:


Python
raw = read_sensor()
scaled = calibrate(raw)
save(raw, scaled)


You must rename every original raw identifier to scaled and every original scaled identifier to filtered. The identifier filtered is initially absent. The final text should preserve which value each occurrence refers to.


Your editor supports replacement passes that replace every current occurrence of one exact identifier. You will finish both passes before running the file.


Which sequence produces the required final text?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Editors Questions: