Hi there -
I'm still new to python, and been stuck playing around with this for a while and would appreciate someone pointing out where I'm going wrong.
Basically I am trying to build a list that contains a number of different objects, with each object having several attributes.
My attempt is simplified and shown below, basically I built a class for this object, containing several values, and then tried to build a list to contain the objects - it doesn't seem to be heading anywhere successful!
Any suggestions would be greatly appreciated.
class TagData(object):
def __init__(self):
self.tag = []
self.val = []
self.rel = []
self.database = []
self.description = []
tagvalue='xxx'
tagList=[]
tagList.append(TagData.tag(tagvalue))
tagList.append(TagData.val(val1))
Currently I am getting an error saying TagData has no attribute 'tag'
Thanks,