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 trialYoussef Moustahib
7,779 PointsWhy won't it append?
Can someone please help. When I try to append something from 'dessert' it won't append the list of snacks, but for 'drinks' and 'takeaway' it will?
Name is 'vending2.py'
code:
Thanks
1 Answer
Jennifer Nordell
Treehouse TeacherHi there! The problem lies in the comparison in the elif
for the desserts.
You wrote:
elif dessert == 'dessert':
But dessert is a list defined earlier in your code. I feel like you meant to check choice
so you would need:
elif choice == 'dessert':
Hope this helps!
Youssef Moustahib
7,779 PointsYoussef Moustahib
7,779 PointsI can't believe I missed that, I thought I left those types of mistakes in the past! lol