Here is my simplified code as i can't post my actual code in python 3:
class example(object):
def __init__(self, list1):
self.list1 = list1
def __repr__(self):
if len(self.list1) > 0:
for i in self.list1:
for j in range(1,len(self.list1)):
return ('{0:}{1:}').format(j, i)
x = example(['this', 'is', 'a', 'list'])
x
This should return:
1this
Now im wanting it to return:
1this
2is
3a
4list
How do i go about doing this?