- This event has passed.
6 PM – Intro to Python – Joshua
June 20 @ 6:00 pm - 7:00 pm
Today We Did
- Review How to write a list: name_of_list = [ 0, “string”, “string2”]
- How to add things to list
- Way 1: Appending -> name_of_list.append(new_object)
- Way 2 : Inserting -> name_of_list.insert( 1, new_object)
- How To replace things in lists
- name_of_list[1] = new_object
- How to Delete things
- Way 1: Delete – >del name_of_list[0]
- Way 2 Pop -> x = name_of_list.pop()
- If you want to pop a specific, put its location within the parentheses Ex. .pop(1)
- Popping is good if you need to use it later
- Way 3: remove -> name_of_list.remove(“string”)
- Allows you to remove the first instance of it
- Useful if you know the object/data/string but not Where it is
Homework
- TRY IT YOURSELF from page 41-42: 3-4, 3-5, 3-6
- Name it List_practice_june_20.py
- Upload your answer to google drive before next week Wednesday night.
If you have any questions feel free to email me jwidjanarko@ayclogic.com