(True*
).print(multiply((((True*1)+(True*1))+0.5), test))
from re import findall, sub
line = """
print(multiply((((True*1)+(True*1))+0.5), 2))
"""
numbers = ["1", "2"]
for item in numbers:
line = sub(
r"^(?!\(True\*)\b{}\b".format(item), "test", line
)
print(line)
from re import findall, sub
line = """
print(multiply((((True*1)+(True*1))+0.5), 2))
"""
numbers = ["1", "2"]
for item in numbers:
line = sub(
r"(?<!True\*)\d".format(item), "test", line
)
print(line)
print(multiply((((True*1)+(True*1))+test.test), test))