Remove first characters from a list
<p>I'm working on a program to have a user input what they want for dinner and then output a shopping list. Currently user can enter which meals they want and it will print out the list sorted in order from produce, meat, and other. </p>

<p>I want the program to output the material without the category number in front and with a line break after each entry but I've had some problems dealing with lists instead of strings. So far I've tried a regex to replace numbers with nothing or substituting the numbers with spaces. </p>

<p>Bonus points if someone knows a way to enter in nachos twice and print out 2xchicken instead of chicken twice. </p>

<pre><code>enter code here

strog = ["3 egg noddles", "3 beef broth", "2 steak"]
c_soup = ["2 bone in chicken", "1 carrots", "1 celery", "1 onion", "1     parsley"]
t_soup = ["3 tomato saucex2", "3 tomato paste", "1 celery"]
nachos = ["3 chips", "3 salsa", "3 black olives", "2 chicken", "3 cheese"]
grocery = []
done = []
food = ""
while food != done:
    food = input("Please enter what you would like to eat. Enter done when finished: ")
    grocery += (food)
grocery.sort()
print(grocery)
</code></pre>

<p>Seems like you just need to learn normal python <a href="https://developers.google.com/edu/python/strings" rel="nofollow">string manipulation</a> and list&lt;->string conversion (<code>split</code> and <code>join</code>).</p>

<p>Try something like this:</p>

<pre><code>strog = ["3 egg noddles", "3 beef broth", "2 steak"]

for ingredient in strog:
    print(" ".join(ingredient.split()[1:]))
</code></pre>

<p>Or un-uglified:</p>

<pre><code>strog = ["3 egg noddles", "3 beef broth", "2 steak"]

for ingredient in strog:
    pieces_list = ingredient.split()
    food_list = pieces_list[1:]
    ingredient_without_number = " ".join(food_list)
    print(ingredient_without_number)
</code></pre>

python