On 05/25/2012 09:12 AM, Harvey Greenberg wrote: > elementary ques...I set > s.name = ["a","b"] > s.value = [3,5] > > I get error that s is not defined. How do I define s and proceed to > give its attributes?
You just have to initialize s as an object that's willing to take those attributes. The most trivial way I can think of to do that would be to create an empty class for the purpose. class MyClass: pass s = MyClass() s.name = ["a","b"] s.value = [3,5] Of course if you told why you want to do it, we might be able to suggest a better type for s. -- DaveA -- http://mail.python.org/mailman/listinfo/python-list