# Replacing data in a list with sublists

**URL:** <https://forum.dynamobim.com/t/replacing-data-in-a-list-with-sublists/113147>\
**Category:** Uncategorized\
**Created:** [November 20, 2025, 5:55pm UTC](https://forum.dynamobim.com/t/replacing-data-in-a-list-with-sublists/113147 "2025-11-20T17:55:47Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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 21, 2025, 3:13pm UTC](https://forum.dynamobim.com/t/replacing-data-in-a-list-with-sublists/113147/5 "2025-11-21T15:13:40Z")

</div>

You’re still not appending to a list. You’re just replacing the value in `quart` each time. You’re effectively doing this:

```auto
quart = 1
quart = 2
quart = 3
quart = 4
return quart (quart = 4)

```

You’re overriding the value each time in the loop and then asking for the final value. You want to append that value (or the entire sublist in this case) each time you update the value, because appending will add to a new list rather than replace an existing one.

I also don’t think you’re creating your sublist properly (`quart=quart+quart`). Each loop is duplicating the previous sublist. You’re effectively doubling the list length with each iteration.

```auto
quart = [["A","B","C","D"]]
for rr in range (0,4):
    quart = quart+quart
    print("Loop:",rr)
    print("quart:",quart)

```

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

Again, you marked your previous thread as [Solved](https://forum.dynamobim.com/t/list-sublist/113068/14) and this seems to be the same issue (or a very similar one). If this is a different issue, then you need to clearly indicate why it’s different. If it’s not, then you need to continue the original thread rather than rehashing the same problem in a new topic.

---

_[View the full topic](https://forum.dynamobim.com/t/replacing-data-in-a-list-with-sublists/113147)._
