```py def add(array): inp = int(input('enter a value')) while inp: array.append(inp) inp = int(input('enter a value')) print(array) ``` should do virtually the same thing, reordered stuff but yet I think it works
to not repeat the input part could use walrus operator ```py while (inp := int(input())): ... ```