config.py holds a number and a class whose method uses that number. The program main.py imports both and then changes a variable called RATE in two places.
config.py:
RATE = 2
class Meter:
def reading(self, n):
return n * RATE
main.py:
import config
from config import Meter, RATE
m = Meter()
RATE = 5
first = m.reading(3)
config.RATE = 10
After this code, which of these expressions are True? Select all that apply.One or more options are correct. Tick all the correct ones: a wrong option costs marks, and a part-right answer earns part of the marks.
Log in to join the discussion.
Loading…