Jojo Maquiling
2013-05-24 01:40:59 UTC
Here is the issue that i need to address:
*
*
*# My declaration is just fine here *
def __init__(self,fname,lname):
self.Firstname = fname
self.Lastname = lname
*# adding a value also goes fine. *
*#but then when i use listing and print it, here comes the problem*
*
*
PublicKeyToken=b77a5c561934e089]] object at 0x029E7C60>
*Traceback (most recent call last):*
* File "<pyshell#78>", line 2, in <module>*
* print l.Firstname*
*AttributeError: 'Object' object has no attribute 'Firstname'*
*
*
Can any body help me on how to do this properly?
Thanks and best regards,
Jojo Maquiling
*
*
*
*
*
*
*# My declaration is just fine here *
def __init__(self,fname,lname):
self.Firstname = fname
self.Lastname = lname
*# adding a value also goes fine. *
j = person('jojo','maquiling')
j
<__main__.person object at 0x029E7C88>j
j.Firstname
'jojo'j.Lastname
'maquiling'*#but then when i use listing and print it, here comes the problem*
*
*
listing = List[person]()
listing
<System.Collections.Generic.0, Culture=neutral,listing
PublicKeyToken=b77a5c561934e089]] object at 0x029E7C60>
listing.Add(person('pepe','smith'))
print l.Firstname*Traceback (most recent call last):*
* File "<pyshell#78>", line 2, in <module>*
* print l.Firstname*
*AttributeError: 'Object' object has no attribute 'Firstname'*
*
*
Can any body help me on how to do this properly?
Thanks and best regards,
Jojo Maquiling
*
*
*
*