I am trying to write a function that takes a string of 1 and 0 and replaces the 1 with "." and the 0 with "_"
I am not sure how to store the new string and print it afterwards
def transform (x):
text = ''
for i in range(x):
if i == 1:
i = "."
text += i
else:
i = "_"
text += i
return text
transform(10110)