Open study

is now brainly

With Brainly you can:

  • Get homework help from millions of students and moderators
  • Learn how to solve problems with step-by-step explanations
  • Share your knowledge and earn points by helping other students
  • Learn anywhere, anytime with the Brainly app!

A community for students.

MIT Week6 homework -- Classes Question: Why does the code below output 10:30? Also, the homework asks us if paris_clock and boston_clock are different objects. I did an "is" test which returns True. But what am I supposed to learn from this? class Clock: def __init__(self, time): self.time = time def print_time(self): print self.time boston_clock = Clock('5:30') paris_clock = boston_clock paris_clock.time = '10:30' boston_clock.print_time() #ends up printing 10:30

MIT 6.189 A Gentle Introduction to Programming Using Python (OCW)
See more answers at brainly.com
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Join Brainly to access

this expert answer

SIGN UP FOR FREE
Can anyone tell me if I can edit a question after I post it?
i guess the point was to show that boston and paris are indeed the same object - when you set paris to 10:30, you have also set boston, the same object, to 10:30. paris would be an independant object had you used paris = Clock('5:30'), which would not have had any effect on boston.
Paris and Boston clock are different object,the issue is assignment ,where Boston_clock is been assigned to Paris_clock, good lock

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

Not the answer you are looking for?

Search for more explanations.

Ask your own question