0
Creating class constructors
I can’t quite get this, has anyone got a clue? Fill in the blanks to create a class and it’s constructor, taking one name and assigning it to the name “attribute”. Then create an object of the class. Class student: Def __init__(self, name): Self ***** = name Test = Student (“Bob”) The *’s represent the unanswered part! Can anyone help?
17 Answers
0
self.attribute = name
0
nope it doesnt fit!
0
it only has 5 characters!
0
The solution is likely '.name'.
But that's not what your question suggests.
0
nope its not name either!
0
Sure you copied the riddle correctly? Where's it even from?
0
im positive! triple checked!
0
Because the syntax is all over the place. ;-p
0
nope checked!
0
I just looked it up in the Tutorial since you just wouldn't tell me.
.name it is, just as I said.
0
no it is not, i just told you, that was the second answer i used, well before posting to this forum, and it has five characters! sorry!
0
Also in the riddle description it says:
'name' attribute,
not
name 'attribute'.
And look at your code: Indentation has totally disappeared, def and class starting with capitals...
Let me tell you one thing now:
Sloppy doesn't work with code. You got to pay more attention to the details!
0
.name!
Open your eyes for god's sake, there's a point!!!
0
ive put the point in, dont worry about it ill see someone in a couple of hours!
0
That 'someone' can only tell you what I just told you a few times.
Does your smartphone autocorrect a space in there after the point? (Mine does it.) You'd of course have to erase that.
0
man i told you, ive tried it mant times, I will see someone about it! thanks!
0
What does HonFu stand for? HongKong Kung Fu?? lol! with the picture of a tekken character it fits, Do you do Wing Chun??