9.17. Exercises¶
- For each word in the list - verbs, add an -ing ending. Overwrite the old list so that- verbshas the same words with- ingat the end of each one.
- In XYZ University, upper level math classes are numbered 300 and up. Upper level English classes are numbered 200 and up. Upper level Psychology classes are 400 and up. Create two lists, - upperand- lower. Assign each course in- classesto the correct list,- upperor- lower. HINT: remember, you can convert some strings to different types!
- Starting with the list myList = [76, 92.3, ‘hello’, True, 4, 76], write Python statements to do the following: - Append “apple” and 76 to the list. 
- Insert the value “cat” at position 3. 
- Insert the value 99 at the start of the list. 
- Find the index of “hello”. 
- Count the number of 76s in the list. 
- Remove the first occurrence of 76 from the list. 
- Remove True from the list using - popand- index.
 
- The module - keyworddetermines if a string is a keyword. e.g.- keyword.iskeyword(s)where- sis a string will return either- Trueor- False, depending on whether or not the string is a Python keyword. Import the- keywordmodule and test to see whether each of the words in list- testare keywords. Save the respective answers in a list,- keyword_test.
- The - stringmodule provides sequences of various types of Python characters. It has an attribute called- digitsthat produces the string ‘0123456789’. Import the module and assign this string to the variable- nums. Below, we have provided a list of characters called- chars. Using- numsand- chars, produce a list called- is_numthat consists of tuples. The first element of each tuple should be the character from- chars, and the second element should be a Boolean that reflects whether or not it is a Python digit.
