On Thu, Sep 11, 2014 at 9:42 AM, Juan Christian <juan0christ...@gmail.com> wrote: > Let's say I have the following list: my_list = ['76561198048214059', > '76561198065852182', '76561198067017670', '76561198077080978', > '76561198077257977', '7656119807971 > 7745', '76561198088368223', '76561198144945778'] > > and I have a function with the following signature: def > fetch_users(*steamids) > > Usage: fetch_users("76561198048214059", "76561198065852182", > "76561198067017670", [...])
[text cut] > The problem is that when I give the 'my_list' directly to 'fetch_users' > function it gives me "TypeError: sequence item 0: expected str instance, > list found". Hi Juan, You have a "var-arity" function called fetch_users(), and you'd like to apply it with an explicit list of arguments "my_list". In this case, you want to use the application operator: https://docs.python.org/2/tutorial/controlflow.html#tut-unpacking-arguments ######################## fetch_users(*my_list) ######################## If you have other questions, please feel free to ask. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor