Hi! I am trying to rewrite this code in WL from Python. Can anyone help me? I am confused on how to write the “i in Range” function.
a = [1, 0, 1, 1]
b = [0, 1, 1, 0]
c = []
acc = 0
for i in range(len(a) - 1, -1, -1):
c.append((a[i] + b[i] + acc) % 2)
acc = int((a[i] + b[i] + acc) / 2)
c.append(acc)
print(c[::-1])
Is it something like this?
While[i , Range[Length[num3]] -1]
But how do you write -1, -1?