Class 20 – Friday March 1

Control, control

Think before I act — My problem solving mantra — Make it your also

Otto Warmbier — Your life was stolen from you — Is what we believe


Look both ways


Agenda


Datasets


Problem who_is_the_longest_of_them_all.py

Three possible program runs

Enter text: Otto Warmbier — Your life was stolen from you — Is what I believe

Warmbier

Enter text: Think before I act — My problem solving mantra — Make it your also

problem

Enter text:

problem

Brainstorming

  • If it is the longest word we seen so far, then we need to remember it in order to compare it to the remaining words.
  • If it is not the longest word we seen so far, we take no further interest in it.

Problem spell_check.py

Three possible program runs

Enter text: It was the best of times It was the wurst of times It was October Fest

wurst

fest

Enter text: how much wod can a woodchuck chuck

wod

woodchuck

Enter text:

problem

Brainstorming

  • Import our url module.
  • Specify the URL for the spelling dictionary.
  • Read the contents of the URL and store it as a list of word spellings.
  • Get the user text and convert it into a list of words.
  • For each user word determine whether it is correctly spelled. If it is incorrectly spelled, print it out

To do list