2nd Semester Intro to Computer Science

Do Now 2.06b

Rank the topics below most to least confusing:

  1. Length of lists
  2. Appending elements from a list
  3. Indexing into Lists
  4. Popping elements off a list
  5. Slicing lists
  6. Adding elements to a list
  7. Creating lists
  8. Removing elements from a list

Open up the console and type the following examples into your console.

(Answer the questions in your notebook)

Example 1

 a = ['cats', 'dogs', 'pigs']
 
  1. How would you check if an item was in a three element list?
  2. What if the list was much longer?

Try typing in the following code:

```python a = [‘cats’, ‘dogs’, ‘pigs’] print(‘dogs’ in a) print(‘cows’ in a) ``’

Edit this page Report an issue