<jupyter_start><jupyter_text>Lesson 5<jupyter_code>my_list_1 = [1, 2, 3, 4]
type(my_list_1)
my_list_1
my_list_2 = [
    1,
    2.4,
    'a sting',
    ['a string in another list', 5]
]
my_list_2
my_str = 'A string.'
list(my_str)
[1, 2, 3] + [4, 5, 6]
[1, 2, 3] * 3
my_list_2
2.4 in my_list_2
'a string in another list' in my_list_2
7 not in my_list_2
codon = 'UGG'

start_codon = 'AUG'
stop_codons = ['UAA', 'UAG', 'AGA']

if codon == start_codon: 
    print ('This is the start codon.')
elif codon in stop_codons:
    print ('This is a stop codon')
else:
    print ('This is not a start nor stop codon.')
my_list_2
my_list = [1, 2.4, 'a sting', ['a string in another list', 5]]
my_list
my_list[1]
my_list[0]
my_list[3]
my_list[3][1]
my_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
my_list[-2]
my_list[4]
my_list[0:5]
my_list[0:1000]
my_list[0:-3]
my_list[0::2]
my_list[0:5:2]<jupyter_output><empty_output><jupyter_text>my_list[start:end:stride]<jupyter_code>my_list[::-1]
evens = my_list [::2]
evens
evens_without_end_values = evens[1:-1]
evens_without_end_values
my_list[2:-1:2]
my_list
my_list[4] = 'four'
my_list
a = 3252
print(id(a))

a = 3253
print(id(a))
id(my_list)
my_list[0] = 'zero'
id(my_list)
my_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
my_list_2 = my_list

my_list[0] = 'a'
my_list
my_list_2
my_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
my_list_2 = my_list[:]

my_list[0] = 'a'<jupyter_output><empty_output><jupyter_text>if you slice, don't run into the mutable list problem<jupyter_code>my_list
my_list_2<jupyter_output><empty_output><jupyter_text>Tuples<jupyter_code>my_tuple = tuple(my_list)
my_tuple<jupyter_output><empty_output><jupyter_text>tuple items are immutable, you cannot change the value<jupyter_code>my_tuple[4] = 'four'
my_tuple = (0, 1, 2, 3, 4, 5)
type(my_tuple)
my_tuple[::-1]
my_list = [7,]
type (my_list)
my_tuple = (7,)
type(my_tuple)<jupyter_output><empty_output><jupyter_text>square brackets can be used for tuples for indexing<jupyter_code>my_tuple + (6, 7, 8, 9, 10)
my_tuple = (1, 2, 3)
(a, b, c) = my_tuple
a
b
c<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16090297790585975, 'fraction_numerical': 0.06484149855907781, 'mean_word_length': 5.550314465408805, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '653915', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 1085, 'n_tokens_neox': 1001, 'n_words': 240, 'path': 'lessons/lesson_05.ipynb', 'repo_name': 'jeesoo-js/bootcamp', 'size': '2082'}