project #1
Reverse the order of words in a string. Create and interactive program that ...
- ask the user to enter a text string
- if no string was entered, exit
- create a new string with the words in reverse order
- display the input string and the reversed string
- display the object ID's of the two strings
- loop
Questions
- what defines a word in a text string?
(what separates words?)
- what about hyphenated words?
- are words only defined by the letters a-z?
- what about numbers with commas? (e.g. 12,567,490)
- is a capitalized word the same as an uncapitalized word?
project #2
Count the unique words in a string. Create and interactive program that ...
- ask the user to enter a text string
- if no string was entered, exit
- process the string counting the number unique words in the string
- display the input string and the word counts
- loop
Question: is a capitalized word the same as an uncapitalized word?
Hint: use a Python dictionary?
project #3
Count the unique letters in a string. Create and interactive program that ...
- ask the user to enter a text string
- if no string was entered, exit
- process the string counting the number of unique letters in the string
- display the input string and the letter counts
- loop
Question:
- is a "space" a letter? (computer text vs book text?)
- is a capitalized letter the same as an uncapitalized letter? (characters vs letters?)
How do you find the letters not in a string? (only ASCII characters/letters?)