I wrote this simple code to realize if members in a list are list itself and if so print the members. I would love to hear if it is the right way to approach or not:
listt = ['spam!', 1, ['B', 'R', 'P'], [1 , 2, 3]]
leng= range(len(listt))
def listPrint(listt, leng):
for i in leng:
print "List member",i,":"
list1 = listt[i]
print listt[i]
if isinstance(listt[i], list):
leng2 = range(len(listt[i]))
print 'and the members are:'
for e in leng2:
print list1[e], '\n'
else:
print '\n'
listPrint(listt,leng)