Lookup after a module update

A drawing application uses integer scale factors. Execute the following Python statements in order and complete the table with the exact unitless integer printed beside each label.


Python
scale = 4

def read_scale():
    return scale

def render_preview():
    scale = 11
    return read_scale()

print("A", read_scale())
scale = 7
print("B", read_scale())
print("C", render_preview())
Printed labelInteger value
A
B
C

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 Binding and Scoping Questions: