i used zip(), but it gives me result in list of tuples format. But i don't get in a exact expect format (as mentioned) no loopings are allowed.
On Thu, Oct 11, 2012 at 5:30 PM, Dave Angel <d...@davea.name> wrote: > On 10/11/2012 07:13 AM, Sunil Tech wrote: > > Hi all, > > > > Greetings to you... > > it been so helpful for me to go through your all mails & support & i wish > > it still continues. > > > > I have two text files. > > > > text1 contains > > > > This is from Text1 --- 1st line > > This is from Text1 --- 2nd line > > This is from Text1 --- 3rd line > > This is from Text1 --- 4th line > > This is from Text1 --- 5th line > > > > text2 contains > > This is from Text2 --- 1st line > > This is from Text2 --- 2nd line > > This is from Text2 --- 3rd line > > This is from Text2 --- 4th line > > This is from Text2 --- 5th line > > > > > > i want result in text3 like > > > > This is from Text1 --- 1st line > > This is from Text2 --- 1st line > > This is from Text1 --- 2nd line > > This is from Text2 --- 2nd line > > This is from Text1 --- 3rd line > > This is from Text2 --- 3rd line > > This is from Text1 --- 4th line > > This is from Text2 --- 4th line > > This is from Text1 --- 5th line > > This is from Text2 --- 5th line > > > > but condition is "should not use any loops" > > > > waiting for your reply, > > thank you in advance. > > > > Regards, > > Sunil G. > > > > > > What are the other constraints on this homework assignment? Are list > comprehensions permitted? Seems likely you can do it readily with a > list comprehension using zip(). One line, total. > > > > -- > > DaveA > >
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor