Confusion about Python Functions and Lists
<p>I am trying to create a function to remove an item from the passed list either by a specified index, or item passed. </p>

<p>If the user wishes to remove an item from the list using an index, the third argument passed will be <code>âindexâ</code>, if the user wishes to remove the first item found in the list using the item passed, the second argument will be <code>â{item}â</code> </p>

<p>For example, to remove the item at index 3 from a list, this would be the command <code>myFunction(myList,3,âindexâ)</code></p>

<p>I am quite confused about this function part.  I have written code that does exactly what the question seems to ask, but it does not use a function.  My code is below :</p>

<pre><code>mylist = ["one" , "two" ,"three" , "four" , "five"]
print "list is composed of: "+ str(mylist)
name = raw_input("Index of item to be removed. ex.  1")
name2 = raw_input('"item to be removed. ex. four')
name3 = int(name)
del mylist[name3]
mylist.remove(name2)
print mylist
</code></pre>

<p>It appears that I need to create a function to do this, and then pass in my list, the index/item, etc.)  but I am very lost on this part. </p>

<blockquote>
  <p>It appears that I need to create a function to do this, and then pass in my list, the index/item, etc.) but I am very lost on this part.</p>
</blockquote>

<p><a href="https://www.google.com/webhp#q=define+function+python" rel="nofollow">Google it!</a> (query = "define function python")</p>

<p>Show your research. The basic form of a function is:</p>

<pre><code>def funcname(arg1, arg2, arg3):
   # now you can use the vars arg1, arg2, and arg3.
   # rename them to whatever you want.
   arg1[0] = "bannanas"
</code></pre>

<p>so, </p>

<pre><code>array = ['mango', 'apple']
funcname(array)
print(array) # -&gt; ['bannanas', 'apple']
</code></pre>

python