Jean-Michel Pichavant wrote: > ----- Original Message ----- >> From: "Peter Otten" <__pete...@web.de> >> To: python-list@python.org >> Sent: Thursday, 23 April, 2015 12:26:41 PM >> Subject: Re: May I drop list bracket from list? >> >> subhabrata.bane...@gmail.com wrote: >> >> > Dear Group, >> > >> > list1=[] >> > for file in list_of_files: >> > print file >> > fread1=open(file,"r").read() >> > fword=fread1.split() >> > list1.append(fword) >> > >> > Here the list is a list of lists, but I want only one list not >> > list of lists. >> There is also a dedicated extend() method that takes a list (actually >> an >> iterable) and appends all items in that list: >> >> list1.extend(fword) > > If both list1 and fword are lists, you can also write > > list1 = list1 + fword > or > list1 += fword
Yes, the can of worms is bottomless ;) -- https://mail.python.org/mailman/listinfo/python-list