I am looking to be able to take a user input of a few different words separated by commas, and then add them to an array so that each word they've put in takes up a different index value. This is the function I am using for this:
array = ["cat","dog","house","car"]
print(array)
def append():#accepts a user input and adds it to the array
item = input("What would you like to append: ")
item = item.lower()
array.append(item)#appends the item variable delcared in the above statement
print ("The list is now: ",array)
Currently, this works by taking one user input, changing it to lowercase, adding it to the array and printing it out. I want to have it so the user can input: mouse, horse, mountain and the program will add those three items to the array all separately. At the moment it adds them all together - as it should. I've tried the split() command however all that seems to do is add them as one thing and just put square brackets around them.
Any help would be great. Cheers