Python problem | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Python problem

Why this code is returning memory pointer location rather than value? And how to fix this problem? https://code.sololearn.com/cg6KPgcuT2DN/?ref=app

1st Oct 2020, 3:01 PM
Gajendra Sonare
Gajendra Sonare - avatar
2 Answers
+ 1
__init__ is a constructor used to initialize your class instance: every returned value will be discarded. So remove the print() around the class instantiation, and put it in place of the constructor "return"
1st Oct 2020, 4:07 PM
Bilbo Baggins
Bilbo Baggins - avatar
+ 1
Bilbo Baggins okay, understood. Thankyou for your response
1st Oct 2020, 4:31 PM
Gajendra Sonare
Gajendra Sonare - avatar