# Easiest way to apply level to Python node

**URL:** <https://forum.dynamobim.com/t/easiest-way-to-apply-level-to-python-node/114481>\
**Category:** Revit\
**Tags:** python, dynamo\
**Created:** [April 23, 2026, 3:51pm UTC](https://forum.dynamobim.com/t/easiest-way-to-apply-level-to-python-node/114481 "2026-04-23T15:51:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ning.zhouHNQLJ](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/ning.zhouhnqlj/32/201653_2.png) [@ning.zhouHNQLJ](https://forum.dynamobim.com/u/ning.zhouHNQLJ)\
**Post date:** [April 23, 2026, 3:51pm UTC](https://forum.dynamobim.com/t/easiest-way-to-apply-level-to-python-node/114481/1 "2026-04-23T15:51:13Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/3/53428231827a28347078ba33ff6366d7f0bb5086.png)

---

<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:** [April 23, 2026, 3:58pm UTC](https://forum.dynamobim.com/t/easiest-way-to-apply-level-to-python-node/114481/2 "2026-04-23T15:58:36Z")

</div>

Python nodes don’t have access to list levels. The idea being that you would explicitly write your code to work for the appropriate structure and replication that you need.

If you want to reuse your python code in multiple graphs (or multiple instances in the same graph) with different list levels, then you should create a custom node containing the python logic. The custom node can then use different list levels as needed.

---

<div class="post-metadata">

**Author:** ![Mike.Buttery](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@Mike.Buttery](https://forum.dynamobim.com/u/Mike.Buttery)\
**Post date:** [April 24, 2026, 2:33am UTC](https://forum.dynamobim.com/t/easiest-way-to-apply-level-to-python-node/114481/3 "2026-04-24T02:33:00Z")

</div>

Here is a little helper function that can apply a function across a nested list, keeping the list structure (perhaps a little off topic)

```python
def process_list(nested_list, func=lambda x: x):
    for item in nested_list:
        if isinstance(item, list):
            yield list(process_list(item, func))
        else:
            yield func(item)

```
