# Determine if List is within a Specific Range

**URL:** <https://forum.dynamobim.com/t/determine-if-list-is-within-a-specific-range/44815>\
**Category:** Developers\
**Tags:** python\
**Created:** [December 23, 2019, 8:17pm UTC](https://forum.dynamobim.com/t/determine-if-list-is-within-a-specific-range/44815 "2019-12-23T20:17:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PhillipA](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/phillipa/32/47744_2.png) [@PhillipA](https://forum.dynamobim.com/u/PhillipA)\
**Post date:** [December 23, 2019, 8:17pm UTC](https://forum.dynamobim.com/t/determine-if-list-is-within-a-specific-range/44815/1 "2019-12-23T20:17:52Z")

</div>

Hello,

I need help writing a python or dynamo script that will obtain the index in List 1 based on a specific range. The screenshot below hopefully will demonstrate what I am trying to achieve. Thank you!

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/8/48d11b442eda221b6b54a1ad6e0ef1821391d000.png)

---

<div class="post-metadata">

**Author:** ![PhillipA](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/phillipa/32/47744_2.png) [@PhillipA](https://forum.dynamobim.com/u/PhillipA)\
**Post date:** [December 23, 2019, 9:19pm UTC](https://forum.dynamobim.com/t/determine-if-list-is-within-a-specific-range/44815/2 "2019-12-23T21:19:29Z")

</div>

Here’s a start but I can not figure out how to turn it into a loop to obtain all of the indices.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/4/04796065ae3b400c709004cdb28a4bb484e71044.png)

[test.dyn](https://forum.dynamobim.com/uploads/short-url/gscvSZ6P41q1Guz1RpXgbTvGjwv.dyn) (22.4 KB)

---

<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:** [December 23, 2019, 10:56pm UTC](https://forum.dynamobim.com/t/determine-if-list-is-within-a-specific-range/44815/3 "2019-12-23T22:56:30Z")

</div>

Check all your possibilities first and _then_ check for the results that pass your condition.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/c/fc3bfddf437b3a0e3c558fbedb94873c6f500a65.png)

---

<div class="post-metadata">

**Author:** ![PhillipA](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/phillipa/32/47744_2.png) [@PhillipA](https://forum.dynamobim.com/u/PhillipA)\
**Post date:** [December 25, 2019, 5:38pm UTC](https://forum.dynamobim.com/t/determine-if-list-is-within-a-specific-range/44815/4 "2019-12-25T17:38:36Z")

</div>

Thank you Nick!
