00:01
Hello, for problem 34, you're asked to repeat problem 33, but use turtle instead of to kenter.
00:11
And i used matt potlib in problem 33.
00:15
So i'm going to start by importing random, which will allow us to easily randomly choose our letters and then importing turtle.
00:27
I am in this case defining a function that will count the number of letters.
00:34
This is useful because that will allow us to know how tall each bar should be when we're having turtle draw the bar, the histogram.
00:48
So that's what this function does.
00:51
We're going to start by initializing account where we've got a list of 26 -0.
00:57
And then for each character in our string s, which this is counting.
01:04
If it is alpha, this here is going to then add it to add it to the correct place.
01:15
So that will return a list of 26, which will have each element being the number of times the corresponding letter showed.
01:27
App.
01:31
Just like the previous one, if you watched my video on it, i'm going to have a string with all of the lowercase letters.
01:37
And for this one, i also have labels, which i'm going to use to put at the bottom of the sort of graph.
01:45
So i just spaced out the letters so that the spacing worked out more nicely in turtle.
01:53
Again, i've got choices being equal to an empty list...