Class 20 – Monday Octover 14

Control, control

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


Look both ways


Agenda


Downloads


Datasets


To do list


Problem who_is_the_longest_of_them_all.py

Three possible program runs

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

problem

Enter text: Remember always — Seek to be both great and good — The world needs your aid

Remember

Enter text:

 

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 beste of times It was the wurst of times It was Oktoberfest

beste

wurst

oktoberfest

Enter text: how much wod can a woodchuck chuck

wod

woodchuck

Enter text: to be or not to be that is the question

Enter text:

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

Problem who_are_the_longest_of_them_all.py

Three possible program runs

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

['problem', 'solving']

Enter text: Remember always — Seek to be both great and good — The world needs your aid

['Remember']

Enter text:

[]

Brainstorming

 


 

 

 
   
   
   
 
  © 2019 Jim Cohoon   Resources from previous semesters are available.