[Tutor] Files Merging

Sunil Tech sunil.techspk at gmail.com
Thu Oct 11 14:27:58 CEST 2012


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 at 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20121011/59e944f0/attachment.html>


More information about the Tutor mailing list