<jupyter_start><jupyter_text>ListsLists are objects that let you hold on to multiple values at once in a sane and organized fashion.  IntroductionLists are ordered collections of objects.  Objects in lists can be of any type.  You can also add and remove list entries.  They are indicated by "`[`" and "`]`" brackets.```my_list = [1,2,3]```  Indexing Predict what this code does.<jupyter_code>some_list = [10,20,30]
print(some_list[2])
some_list = [10,20,30]
print(some_list[0])
some_list = [10,20,30]
print(some_list[-1])<jupyter_output><empty_output><jupyter_text>SummarizeHow do you access elements in a list?  Predict what this code does.<jupyter_code>some_list = [10,20,30,40]
print(some_list[1:3])
some_list = [10,20,30]
print(some_list[:3])<jupyter_output><empty_output><jupyter_text>SummarizeWhat does the "`:`" symbol do?  ModifyChange the cell below so it prints the second through fourth elements in the list.<jupyter_code>some_list = [0,10,20,30,40,50,60,70]
print(some_list[2:4])<jupyter_output><empty_output><jupyter_text>Setting values in lists Predict what this code does.<jupyter_code>some_list = [10,20,30]
some_list[0] = 50
print(some_list)<jupyter_output><empty_output><jupyter_text>Predict what this code does.<jupyter_code>some_list = []
for i in range(5):
    some_list.append(i)
print(some_list)<jupyter_output><empty_output><jupyter_text>Predict what this code does.<jupyter_code>some_list = [1,2,3]
some_list.insert(2,5)
print(some_list)
some_list = [10,20,30]
some_list.pop(1)
print(some_list)
some_list = [10,20,30]
some_list.remove(30)
print(some_list)<jupyter_output><empty_output><jupyter_text>SummarizeHow can you change entries in a list?  ImplementWrite a program that creates a list with all integers from 0 to 9 and then replaces the 5 with the number 423.  Miscellaneous List Stuff<jupyter_code># You can put anything in a list
some_list = ["test",1,1.52323,print]
# You can even put a list in a list
some_list = [[1,2,3],[4,5,6],[7,8,9]] # a list of three lists!
# You can get the length of a list with len(some_list)
some_list = [10,20,30]
print(len(some_list))<jupyter_output><empty_output><jupyter_text>Copying lists(a confusing point for python programmers)  Predict what this code does.<jupyter_code>some_list = [10,20,30]

another_list = some_list
some_list[0] = 50

print(some_list)
print(another_list)<jupyter_output><empty_output><jupyter_text>Predict what this code does.<jupyter_code>import copy

some_list = [10,20,30]

another_list = copy.deepcopy(some_list)
some_list[0] = 50

print(some_list)
print(another_list)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11791907514450867, 'fraction_numerical': 0.05163776493256262, 'mean_word_length': 7.428571428571429, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '355510', 'license': 'Unlicense', 'n_tokens_mistral': 1042, 'n_tokens_neox': 957, 'n_words': 239, 'path': 'chapters/00_inductive-python/05_lists.ipynb', 'repo_name': 'lperezmo/pythonic-science', 'size': '2595'}