I’m pretty sure there’s some sort of bug in this exercise that’s not letting me do it properly. Firstly I kept on getting the error "9/script.py has been moved. This will cause problems with this exercise, please move 9/script.py back to its original location, or reset your files”. I managed to get rid of it by resetting the code, and reentering my code in exercise 9.
However now the stuff in the console is contradictory to what the lesson explanation says should be in the console. Please look below as to what is in my console. Note that this is actually not what I wrote for the previous exercise but seems to be some sort of default solution.
In the lesson description it says “However, classes and objects are often used to model real-world objects. The code in the editor is a more realistic demonstration of the kind of classes and objects you might find in commercial software. Here we have a basic ShoppingCart class for creating shopping cart objects for website customers; though basic, it’s similar to what you’d see in a real program.”
As evidenced below this is clearly not what’s in the console. How can I solve this problem? Do I really need to start the whole classes section from the beginning again?
class Animal(object): """Makes cute animals.""" is_alive = True health = "good" def __init__(self, name, age): self.name = name self.age = age # Add your method here! def description(self): print self.name print self.age hippo = Animal('Anderson', 36) sloth = Animal('Dale', 15) ocelot = Animal('Fuzzy', 7) print hippo.health print sloth.health print ocelot.health