I am trying to create a simple function to run through a while loop and append the entered IP addresses into a list for other uses. What I can see with my print statements is I only append to the list variable the IP most recently entered and the last print of the list returns a blank list.
def IP_Range():
while True:
ipLIST = []
IP = raw_input('Please enter IP or Network, enter "end" to break: ')
if IP == 'end':
break
else:
ipLIST.append(IP)
print ipLIST
print ipLIST
IP_Range()
Thank you in advance I know this is really simple and I am overlooking something obvious. As you can tell I am new to Python and programming in general.