Link to home
Start Free TrialLog in
Avatar of dfernan
dfernanFlag for United States of America

asked on

access an attribute of a class from a list

I have the following class.
class chrom(object):
      """docstring for chrom"""
      def __init__(self, chr, position, ma2c):
            self.chr = chr
            self.position = position
            self.ma2c = ma2c
and then i have a list of this chrom objects called chromlist.

Let us imagine I want to create a sublist with the position of the items i to j from the chromlist!!!!

How would i do that in the esiest and most efficient way. I can' t do chromsublist[0:4].position???? why?
SOLUTION
Avatar of Roger Baklund
Roger Baklund
Flag of Norway image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial