The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

classes and objects

classes and objects

0
Votes
1
Answer

Hello,
I get an error when I tried same code in the lecture concerning assigning instances to a class.
Images of the code and error are attached in the links below:-
https://ibb.co/7NpYL85
https://ibb.co/PmH4HDv
Thanks for your effort.
Kind Regards.
 
 

1 Answer

365 Team
0
Votes

Hi Hady, 
thanks for reaching out! The problem seems due to the fact you’ve written ‘Init’ with a capitol ‘I’.
Try the following instead:
class P(object):
    def __init__(self, name, age):

 
Best, 
Eli