The Artima Developer Community
Sponsored Link

Python Answers Forum
Need help

1 reply on 1 page. Most recent reply: Sep 26, 2006 2:25 AM by Michael Grazebrook

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
huan chen

Posts: 1
Nickname: kick
Registered: Jul, 2006

Need help Posted: Jul 15, 2006 2:33 PM
Reply to this message Reply
Advertisement
split([1,3,5,7,9,10]) splits into two strings with first half and second half, the function returns two lists, here it returns [1,3,5] and [7,9,10]

merge(m1,m2) takes two arguments and merge m1 and m2 into one list

however,
k = merge(split([1,3,5,7,9,10]) should be working well, right?

But when i compile it, it said TypeError: merge() takes exactly 2 arguments (1 given)

How do I fix this. PS i need split function as merge argument

thx


Michael Grazebrook

Posts: 2
Nickname: michaelg
Registered: Sep, 2006

Re: Need help Posted: Sep 26, 2006 2:25 AM
Reply to this message Reply
> k = merge(split([1,3,5,7,9,10]) should be working well,
> right?

Split probably returns a tuple. Try:

merge(*split(my_list))

Flat View: This topic has 1 reply on 1 page
Topic: Calling modules in Python Previous Topic   Next Topic Topic: python spyware?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use