When i run the viewinfo() function, i dont get the real information printed out, any idea how to fix it? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

When i run the viewinfo() function, i dont get the real information printed out, any idea how to fix it?

I know its a list of objects but how do i get the real content printed out? https://code.sololearn.com/c85wUDDd7OR1/?ref=app

21st May 2022, 11:40 AM
Lenoname
1 Answer
0
A search about this always brings up repr(): def __repr__(self): return somefunction(self) repr(instance) and using self I think implies the attribute hsving already been initialized by the __init__(self) constructor, and that I think requires that you change some of your code, maybe gathering the listing of all other info but from the lists class that a new allinfo class would inherit, I dunno, so instead of appending each to allinfo you just create an instsnce of all info witj all the others as attributes from the inherited class... I'm kind of stalking this to see the responses. This is a nice question to learn more about how classes work.
23rd May 2022, 2:15 AM
Korkunç el Gato
Korkunç el Gato - avatar