Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Python Collections (2016, retired 2019) Dictionaries Word Count

eestsaid
eestsaid
1,311 Points

Word count challenge - where to start

Not really sure where to start with this one. Steps Im thinking about are:

  • Change the string to a list using split
  • Run a for loop to get the count of each word and put the word and the count in a new list
  • Change the list to a dictionary

Problem with the above it doesn't really draw on recent content so seems arbitrary and the most common method I've been able to find t change a list to dictionary is using the dict() method.

Do the above steps sound like I might be on the right path???

Thanks team

2 Answers

you are close!

You also need to use nested for loop and a counter

eestsaid
eestsaid
1,311 Points

Thanks bot.net - I've taken a breather from this challenge and will come back to it. I will let you know how I go.