Two functions you need to implement:
stringToCharLst( inputString ) [returns a list]
- This function takes a string in the following format: "XXX-XXX-XXXX" (where X is a character between
['0'-'9'])
- The function should return a list ['X', 'X', 'X', '-', 'X', 'X', 'X', '-', 'X', 'X', 'X', 'X']
charsToWord( a list ) [returns a list of words]
This function takes in the list of characters ['0'-'9' and '-'].
Use a dictionary that has the following key : value association.
{'0':'zero', '1':'one', ..., '9':'nine', '-':'dash'}
This dictionary will make it easy to convert the list passed to this function to a new list where the characters
have been converted to words.
- For example, an input of ['1', '2', '3'] would return a list ['one', 'two', 'three'].
*Optional function*
sayWordList( a list ) [no return]
If you are using windows or mac, you can install the "pyttsx3 module" to do "text to speech." See the video for
more details on how to install this module.
This function should say each word in the list (hint: loop through the list and pass each string to engine.say(..).
[See code]
Note: Implementing this function is optional and just intended for you to have "fun" and see the power of
python. You will not get additional points for implementing it or points deducted for not implementing it, so
please ensure the rest of your lab is correct.