Pairing Lists, in order, varying lengths?

13 views
Skip to first unread message

Jake Van

unread,
Oct 20, 2014, 10:47:55 PM10/20/14
to python_in...@googlegroups.com
Is it possible to pull from two lists in order?

If  list1 = A - Z and list2 = a - z, then I would want it to pull from those lists to parent them.

Aa, Bb, Cc

Where the lists would be varying lengths, but always equal.

I know there has to be a way, but I can't seem to figure it out.
I had some script that I tried, but I didn't save it. I will keep trying. I tried looking it up, but I feel like I am asking phrasing my questions wrong because I keep getting things that don't deal with this issue.

Thanks guys.

Chad Dombrova

unread,
Oct 20, 2014, 10:57:59 PM10/20/14
to python_in...@googlegroups.com, python_in...@googlegroups.com
Check out the zip function, as well as itertools.izip and itertools.izip_longest


Sent from Mailbox


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/d53c63b5-8d59-4e12-afcb-d80a8765295a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Justin Israel

unread,
Oct 20, 2014, 11:23:15 PM10/20/14
to python_in...@googlegroups.com

That's so weird. I literally just imported izip_longest to use in my own code, at the same time you sent this reply. I hadn't used it in months.

What a coincidence.

Reply all
Reply to author
Forward
0 new messages