My intent here this to query the user for multiple inputs using a loop that stops when the user inputs and integer of zero. I need to be able to recall the data in a later line of code. With that in mind I'm trying to create a list of the users input.
Python 3 code
i = False
val1 = []
while i == False:
if val1 != 0:
val1 = eval(input("Enter an integer, the value ends if it is 0: "))
else:
i = True
print(val1)
if val1 != 0:you should not assign, but.appendto a list. Like this:val1.append(eval...)