In <2333bfb4-cd72-4ed0-9b28-d8dbe26b5...@googlegroups.com> Ravi Prabakaran <ravi....@gmail.com> writes:
> Hi, > I'm completely new to python. I just need simple logic to get output without > any loops. > I have list of string and list of list of numbers. > Each string should be concatenated with every third and fourth values to > generate proper titles in list of strings. > t = ['Start','End'] > a = [[1,2,3,4], > [5,6,7,8]] > Expected Result : ( list of strings ) > ['Start - 3 , End - 4', > 'Start - 7 , End - 8'] > Note : First 2 values from each list should be ignored. > Could anyone please guide me with best solution without loops ? output_list = [] t = ['Start','End'] a = [[1,2,3,4], [5,6,7,8]] output_list.append('%s - %s, %s - %s' % (t[0], a[0][2], t[1], a[0][3])) output_list.append('%s - %s, %s - %s' % (t[0], a[1][2], t[1], a[1][3])) print output_list -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.com watch 'House', or a real serial killer to watch 'Dexter'. -- https://mail.python.org/mailman/listinfo/python-list