That's not how computers think. They don't like that.

They're not dynamic like we are.

Even though sometimes we write programs that make them seem dynamic,

that's not how they work.

So if you had to really solve this program, you probably if you were smart,

would have made a little piece of paper.

And you would have a drawn a little picture like this.

And you would have done, each time you would look at the name,

you would check to see if it was a name that you already saw.

And if it was a name you already saw, you'd add one to that name.

And you're like okay, there's one more of those and

there is one of those now I have another one of those and I got one of those,

two of those and whatever and, or here is a new one here and I got one of those and

on and on and on just tick these things off as you move through.

And then when you're all done now you go look at these numbers.

You know 5, 7, 6, 5, 1 and you're like okay that's the one that I want.

And so this is a little set of counters and you can think of this as a histogram.

It's like a little histogram that's growing and

each time you see one you add a little bit more, and you add a little bit more, and

you add a little more and more, add a new one.

Grow that one, grow this one, grow this one,

grow this one, and then you're all done you got sort of the tallest histogram.

You could think of these numbers as growing histograms with the names

here on the horizontal axis.

That would be a way to mentally think about this problem

for a human to think about the problem.

And so, we're going to use dictionaries, and we're in those dictionaries we

are going to make the keys be these things, the actual strings, these names.

And then the values will be the current count, and

then we're going to update those counts.

So that's the data structure that we're going to build

in Python. And it's really common for histograms or

any other word counting, various other things, any kind of frequency.

So what we're going to do is we going to take these names, csev, or cwen, and

we're going to use those as the keys and

we're going to use strings as our keys in our dictionary.

So, we start with our dictionary and the first time we see csev, so

we haven't seen them yet.

And so we put we'll put 1 in the, in the, there, under csev, under the tag csev.

We see cwen for the first time, so we put 1 under for her, and then we print.

It's like this is our current histogram as we got it so far.

csev has 1, cwen has 1.

csev has 1, cwen has 1, but we're not done yet.

Now we see cwen again and we go grab, what was the previous number we had for

cwen, well it was 1.

Add 1 to that so that's kind of like ticking this and then stick it back in so

that's storing it in.

So now we have this dictionary that's kind of growing as time is progressing.

So cwen has 2, chuck has 1, and away we go.

So you get the idea that if we use the names of these people from our input data

as the keys in the dictionaries

and the values are the counts, then we can easily make a histogram that we can expand

every time we see a new name.

Update the old ones, update the new ones, add a new one etc, etc, etc.

That this works in a very nice and dynamic way.