Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
ABCD EFGH
Courses Plus Student 582 PointsNo Idea why this is happening
I am using the 2016.1 community edition of PyCharm, and my code is exactly the same more or less. So why does this:
# Shopping List
shopping_list = []
print("What's on for today?")
print("""Enter "DONE" to stop adding your items to the list""")
while True:
newItem = raw_input("> ")
if newItem == 'DONE':
break
shopping_list.append(newItem)
# quit
print("Here is your list:")
for item in newItem:
print(item)
give me this?
/usr/bin/python /Users/heathrobertson/Documents/Python/Treehouse/ShoppingList/ShoppingList.py What's on for today? Enter "DONE" to stop adding your items to the list
Pick up new dishwasher eat food plan out new jumping castle DONE Here is your list: D O N E
Process finished with exit code 0
1 Answer
Carlos Federico Puebla Larregle
21,074 PointsIn that last for loop, don't you have to iterate over the "shopping_list" variable that has an array of every item instead of the "newItem" variable?
ABCD EFGH
Courses Plus Student 582 PointsABCD EFGH
Courses Plus Student 582 PointsAh ok yes I see now! Thanks!