# Pytion Script, digit for int list

**URL:** <https://forum.dynamobim.com/t/pytion-script-digit-for-int-list/104882>\
**Category:** Revit\
**Tags:** revit, python, dynamo\
**Created:** [October 4, 2024, 2:02am UTC](https://forum.dynamobim.com/t/pytion-script-digit-for-int-list/104882 "2024-10-04T02:02:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jh.lee5YTTX](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@jh.lee5YTTX](https://forum.dynamobim.com/u/jh.lee5YTTX)\
**Post date:** [October 4, 2024, 2:02am UTC](https://forum.dynamobim.com/t/pytion-script-digit-for-int-list/104882/1 "2024-10-04T02:02:31Z")

</div>

I have a list. 1..12..1;  
I want to make it like [01, 02, 03 … 12]

How can I do it? I was using Python script like following but I failed.

* * *

# The inputs to this node will be stored as a list in the IN variables.

dataEnteringNode = IN

# Place your code below this line

a = ;

for i in IN[0]:  
a.append(format(i, ‘03’))

# Assign your output to the OUT variable.

## OUT = a

but result is [13, 23, 33, 43, 53, 63, 73, 83, 93, 103, 113, 123]  
I expected [01, 02, 03. … 12]

---

<div class="post-metadata">

**Author:** ![harilalmn](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/harilalmn/32/116193_2.png) [@harilalmn](https://forum.dynamobim.com/u/harilalmn)\
**Post date:** [October 4, 2024, 2:22am UTC](https://forum.dynamobim.com/t/pytion-script-digit-for-int-list/104882/2 "2024-10-04T02:22:09Z")

</div>

OUT = [str(n).zfill(2) for n in IN[0]]

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

---

<div class="post-metadata">

**Author:** ![jh.lee5YTTX](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@jh.lee5YTTX](https://forum.dynamobim.com/u/jh.lee5YTTX)\
**Post date:** [October 4, 2024, 2:32am UTC](https://forum.dynamobim.com/t/pytion-script-digit-for-int-list/104882/3 "2024-10-04T02:32:34Z")

</div>

It worked! Thank you.
