2. Class Syntax - Could this error be caused by an internet browser compatibility?


#1



https://www.codecademy.com/en/courses/python-intermediate-en-WL8e4/0/2?curriculum_id=4f89dab3d788890003000096

So, as seen in the code below, The instructions tell me to define a class called animal that takes on the keyword pass. The error i recieve is "Oops, try again. Did you create a class with the name Animal?" Which I have done. I have tried this exersize in IE and now Chrome. I've refreshed the page and I am just curios as to what could be causing my error.

I expected the class to be taken and solved, but I am going to snoop around on the fourums and see if I can find the answer, but I just want to know if it a browser issue. I imagine it is not.


class Animal(pass):
    {
        "Animal" = "Pikachu",
        "Food" = "Ketchup",
}


#2

So! Apperently pass is used as filler inside of a class and allows Python to look past the definition, it does not go into the keyword area.


#3

class Animal(object):

all classes are inherits of object class, so if you are crating your parent class it must inherit object class


#4

It will automatically inherit from object if you just put:

class Cow:

#5

class Animal(pass):
{}


#6

try this --
class Animal(object):
pass


#7

class Animal(object):
{}


#8

class Animal(object):
{
}


#9

I tried all sorts of combinations - still new to everything.

In order to move forward HAD to type in:

class Animal(object):{
}

So, I don't know what good the pass function is or where it should have gone.I did use pass on the next exercise. I think I get the point of it.


#10

I don't get it! Sorry for piggy backing. Won't let me start a new topic. What's wrong here?


#11

try this...
class Animal(object):
pass


#12