3/09/2014

python study, Get list item using __getitem__ function

list = (('Tom', 24), ('Derick',30), ('Peter',53), ('Jane',29))
print( list[0] )
print( list[0].__getitem__(0))
print( list[1].__getitem__(1))
#('Tom', 24)
#Tom
#30


No comments:

Post a Comment