# Stuck with a python logic

**URL:** <https://forum.dynamobim.com/t/stuck-with-a-python-logic/16269>\
**Category:** Lists-Logic\
**Tags:** python, dynamo\
**Created:** [November 6, 2017, 8:49pm UTC](https://forum.dynamobim.com/t/stuck-with-a-python-logic/16269 "2017-11-06T20:49:06Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [November 6, 2017, 9:52pm UTC](https://forum.dynamobim.com/t/stuck-with-a-python-logic/16269/3 "2017-11-06T21:52:13Z")

</div>

As an FYI, you should paste your Python code using the Preformatted Text option. Just highlight your pasted text and click `</>` in the toolbar above.

> [@Yien](#):
>
> is there a way to select the same index value from one list to another?

Yes, but I don’t think that’s what you need here. As @awilliams said, you can wrap your if statement within your for loop.

However, if you wanted to iterate through both lists simultaneously you would use:  
`for i, j in zip(list1, list2):`  
This would essentially get you paired values `list1[0]`/`list2[0]`, `list1[1]`/`list2[1]`, etc.

---

_[View the full topic](https://forum.dynamobim.com/t/stuck-with-a-python-logic/16269)._
