564 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owls only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.
Open the Python program in the above folder and run it - you should see a speech from Julius Caesar:
Will Shakespeare - master of the metaphor.
Analyse this speech to see the word count as follows:
Surprisingly, there are more two-letter words than any other.
Here are some ideas for how to proceed:
Getting a list of words
Use the split function to split your text, using a space character as a delimiter.
Some words contain , and . characters, and some contain \n line breaks. Loop over the list of words, applying the replace function to each to remove these extra characters. You should also use the lower function to convert each word to lower case, to make sure that And is counted with and, for example.
Producing the output
Loop over all the numbers in a range from 1 to (say) 20. For each number, use a list comprehension to find how many words there are with this many letters in (see below), and apply an if statement to print out a message if the number of words is more than zero.
Here is some suggested text for your list comprehension, to give you the idea of the syntax:
# show number of words with this many letters
# (this uses a list comprehension)
number_words = len([x for x in words if len(x) == num])
There are probably better and definitely other ways to solve this; feel free to do your own thing (the result is what counts ...).
When you've got this working, save your program as Speech impediment.py and close it down.
25 Aytoun Street