Python script won't work with lists

first script:

Your input is a list of list - so the code should reflect that. Try:

import re
out = []
for l in IN[0]:
    temp = []

    # l is the sublist
    for i in l:

         # now i is each string
         b = re.sub("[a-zA-Z]+", "", i)
         temp.append(b)

    out.append(temp)
OUT = out

with this, you can connect item from List.GetITemAtIndex directly to Python IN[0]. No need to use l[3] to get one list.

code block having Ironpython error:

Your input IN[0] is an integer 1234, so the 3rd line of digit_test “for i in n” will not work. You cannot loop over a single integer - that is what the warning message said. To make it work, just wrap 1234 with [] to make a list with one item - list can be iterated over.