2. Class syntax


#1



Console says this...

File "python", line 1
class NewClass(object):
^
SyntaxError: unexpected EOF while parsing

Oops, try again. Did you create a class with the name Animal?


class Animal(pass):


#2

pass should be object

then on the next line in the object, put pass


#3

sorry but i dont really get what you mean


#4

when creating a class, pass object as parameter:

class ClassName(object):
   # object content here

then the content of the object should be pass


#5
class Animal(object):
object = pass

like this?


#6

what is inside an object requires indention:

class Animal(object):
    # indention for object content

no, pass is a special keyword, it should be the only thing inside the object. just that one word


#7

im still unsure about it


#8

im still unsure about it

class Animal(object(pass x)):

#9

really?

look here:

class ClassName(object):
   # object content here

all you had to was replace/on the line below the comment put pass, that is it... (make sure it is indented)


#10

okay thanks...
but i felt that maybe you guys can make the instructions clearer? i didnt understand the qn fully...


#11

nothing is stopping you from searching the internet about more information about classes. Classes are a difficult concept, but OOP (object orientated programming) is powerful


#12

@stetim94 dude that was so unhelpful, I'm having the same problem and gleaned nothing from your comments


#13

So you want help, and the first thing you do is comment that voluntary help you are getting is bad

please read the guidelines, make a new topic, fill in the template of the topic so we can help you, this solution was written specifically for karray


#14