Lens splice exercise - list zip count

Hi guys,

Having trouble on question 12 of the below (linked) exercise. My code is linked below too.

Question 12. Count the number of occurrences of 2 in the prices list, and store the result in a variable called num_two_dollar_slices . Print it out.

num_two_dollar_slices = pizzas_sorted.count(2)

When i try to execute "pizzas_sorted.count(2), getting a return of 0. How can i count int on a zipped list?

Exercise: https://www.codecademy.com/paths/computer-science/tracks/cspath-flow-data-iteration/modules/dspath-lists/projects/lens-slice

My code link: https://gist.github.com/bf3ddbdd0bb6f9f8c5f5f2b1703e9c4a

Many thanks

1 Like

This might be useful: Count a zipped list in python

2 Likes