Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

JohnM

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

  • one year ago
  • one year ago

  • This Question is Closed
  1. JohnM
    Best Response
    You've already chosen the best response.
    Medals 0

    Can anyone tell me if I can edit a question after I post it?

    • one year ago
  2. snark
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

    • one year ago
  3. olasunmibo
    Best Response
    You've already chosen the best response.
    Medals 1

    Paris and Boston clock are different object,the issue is assignment ,where Boston_clock is been assigned to Paris_clock, good lock

    • one year ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.