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 trialJason Carr
5,495 PointsAlmost there! Set a variable called "list_size" that contains the number of items in the array. You can use the "count"
I am a bit confused here. Need some help!!
grocery_list = ["milk", "eggs", "bread", "ice cream", "potatoes", "pie"]
first_item = grocery_list[0]
last_item = grocery_list.last
list_size = rocery_list[6]
2 Answers
Jeremy Faith
Courses Plus Student 56,696 PointsThe challenge wants you to use the count method on grocery_list instead of manually counting the number of items. You used the last method in the second challenge so follow that and use grocery_list.count.
Theodore Karropoulos
22,149 PointsRight now you are trying to pass the item at index 6 into list_size array. Try to use the count method.
list_size = grocery_list.count
Jason Carr
5,495 PointsJason Carr
5,495 PointsHey Thanks Jeremy Faith I just noticed where my problem was