# Python test for more then 2 inputs

**URL:** <https://forum.dynamobim.com/t/python-test-for-more-then-2-inputs/64559>\
**Category:** Uncategorized\
**Created:** [June 1, 2021, 2:53am UTC](https://forum.dynamobim.com/t/python-test-for-more-then-2-inputs/64559 "2021-06-01T02:53:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vanman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanman/32/20881_2.png) [@vanman](https://forum.dynamobim.com/u/vanman)\
**Post date:** [June 1, 2021, 2:53am UTC](https://forum.dynamobim.com/t/python-test-for-more-then-2-inputs/64559/1 "2021-06-01T02:53:32Z")

</div>

Hi, does anyone know how I would get this to output the correct list depending on the number. The list is from 0 to 3. Thanks for any help

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

---

<div class="post-metadata">

**Author:** ![ppittas](https://avatars.discourse-cdn.com/v4/letter/p/e274bd/32.png) [@ppittas](https://forum.dynamobim.com/u/ppittas)\
**Post date:** [June 1, 2021, 3:36am UTC](https://forum.dynamobim.com/t/python-test-for-more-then-2-inputs/64559/2 "2021-06-01T03:36:48Z")

</div>

Sounds like you need to turn it into an IF statement then loop for the other possible results. I’m not entirely sure how you would do this with design script but you could use python for this.

---

<div class="post-metadata">

**Author:** ![vanman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanman/32/20881_2.png) [@vanman](https://forum.dynamobim.com/u/vanman)\
**Post date:** [June 1, 2021, 3:45am UTC](https://forum.dynamobim.com/t/python-test-for-more-then-2-inputs/64559/3 "2021-06-01T03:45:36Z")

</div>

yeah I was thinking it might need to be a python input script. Not quite sure what im doing. Brains working on bits and pieces I’ve either made up or seen

```
test = IN[0]
0 = IN[1]
1 = IN[2]
2 = IN[3]
3 = IN[4]

If test = 0:
 OUT = IN[1]
else if test = 1:
 OUT = IN[2]
else if test = 2:
 OUT = IN[3]
else if test = 3:
 OUT = IN[4]
```

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [June 1, 2021, 3:49am UTC](https://forum.dynamobim.com/t/python-test-for-more-then-2-inputs/64559/4 "2021-06-01T03:49:13Z")

</div>

The test will only return ‘true’ or ‘false’. If you want to pull another index beyond 0 or 1, you’ll need to nest multiple tests, as you did in that Python you posted. The Design Script version thereof would be something like this:

```
tests = [t1,t2,t3,t4,t5];
vals = [r1,r2,r3,r4,r5];
indx = t1? 0 : t2? 1 : t3 ? 2 : t4 ? 3 : 4;
vals[indx];

```
