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

Python Python Collections (2016, retired 2019) Lists Pop

Youssef Moustahib
Youssef Moustahib
7,779 Points

Why 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:

https://w.trhou.se/2awtz1rhnl

Thanks

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi 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! :sparkles:

Youssef Moustahib
Youssef Moustahib
7,779 Points

I can't believe I missed that, I thought I left those types of mistakes in the past! lol