Hi, Yes, I tried sending the mail again in plain text. But I think I understood the difference there in using built-in sort function and writing the code without using that.
Thank you On Mon, Jan 4, 2016 at 12:45 PM, Joel Goldstick <joel.goldst...@gmail.com> wrote: > On Mon, Jan 4, 2016 at 12:27 PM, Alan Gauld <alan.ga...@btinternet.com> > wrote: > > > On 04/01/16 16:56, Pooja Bhalode wrote: > > > Hi, > > > I wanted to check if I can write the following program in this manner > as > > > well. > > > > > > > Can you resend in plain text please? > > Your post lost all its formatting so its hard to read > > or comment on. > > > > > def linear_merge(list1, list2): > > > result = [] > > > while len(list1) and len(list2): > > > if list1[0] < list2[0]: > > > result.append(list1.pop(0)) > > > else: > > > result.append(list2.pop(0)) > > > > > > # Now tack on what's left > > > > > > result.extend(list1) > > > result.extend(list2) > > > return result > > > > Like Alan said, send in plain text. Also, give a test case and your > results. Your version uses the built in sort method. The linear merge > doesn't use that, so the writer's are trying to teach you something about > sorting. > > > ... > > > > -- > > Alan G > > Author of the Learn to Program web site > > http://www.alan-g.me.uk/ > > http://www.amazon.com/author/alan_gauld > > Follow my photo-blog on Flickr at: > > http://www.flickr.com/photos/alangauldphotos > > > > > > _______________________________________________ > > Tutor maillist - Tutor@python.org > > To unsubscribe or change subscription options: > > https://mail.python.org/mailman/listinfo/tutor > > > > > > -- > Joel Goldstick > http://joelgoldstick.com/stats/birthdays > _______________________________________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor