<jupyter_start><jupyter_text>2-2.2 Intro Python Lists - List Creation- List Access- **List Append**- List Insert- List Delete----- > Student will be able to  - Create Lists- Access items in a list- **Add Items to the end of a list**- Insert items into a list- Delete items from a list  &nbsp; Concepts Appending to Lists[![view video](https://iajupyterprodblobs.blob.core.windows.net/imagecontainer/common/play_video.png)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{"src":"http://jupyternootbookwams.streaming.mediaservices.windows.net/121939c6-f81e-4787-a7a9-15ab15c69168/Unit2_Section2.2a-Appending_to_Lists.ism/manifest","type":"application/vnd.ms-sstr+xml"}],[{"src":"http://jupyternootbookwams.streaming.mediaservices.windows.net/121939c6-f81e-4787-a7a9-15ab15c69168/Unit2_Section2.2a-Appending_to_Lists.vtt","srclang":"en","kind":"subtitles","label":"english"}])**`.append()`** method adds an item to the end of a list   ```pythonparty_list.append("Alton")```  &nbsp; Examples<jupyter_code># [ ] review and run example
# the list before append
sample_list = [1, 1, 2]
print("sample_list before: ", sample_list)

sample_list.append(3)
# the list after append
print("sample_list after:  ", sample_list)
# [ ] review and run example
# append number to sample_list
print("sample_list start:  ", sample_list)
sample_list.append(3)
print("sample_list added:  ", sample_list)

# append again
sample_list.append(8)
print("sample_list added:  ", sample_list)

# append again
sample_list.append(5)
print("sample_list added:  ", sample_list)

# [ ] run this cell several times in a row 
# [ ] run cell above, then run this cell again
# [ ] review and run example
mixed_types = [1, "cat"]
# append number
mixed_types.append(3)
print("mixed_types list: ", mixed_types)

# append string
mixed_types.append("turtle")
print("mixed_types list: ", mixed_types)<jupyter_output>mixed_types list:  [1, 'cat', 3]
mixed_types list:  [1, 'cat', 3, 'turtle']<jupyter_text>&nbsp; Task 1 `.append()`<jupyter_code># Currency Values
# [ ] create a list of 3 or more currency denomination values, cur_values
# cur_values, contains values of coins and paper bills (.01, .05, etc.)
cur_values = [.01, .05, .10, .25]
# [ ] print the list
print(cur_values)

# [ ] append an item to the list and print the list
cur_values.append(1)

print(cur_values)

# Currency Names
# [ ] create a list of 3 or more currency denomination NAMES, cur_names
# cur_names contains the NAMES of coins and paper bills (penny, etc.)
cur_names = ["penny","nickel","dime"]
# [ ] print the list
print(cur_names)

# [ ] append an item to the list and print the list
cur_names.append("quarter")

print(cur_names)<jupyter_output>['penny', 'nickel', 'dime']
['penny', 'nickel', 'dime', 'quarter']<jupyter_text>&nbsp; Task 2   Append items to a list with `input()`<jupyter_code># [ ] append additional values to the Currency Names list using input()
cur_names.append(input("Currency Name:\n"))
# [ ] print the appended list
print(cur_names)<jupyter_output>Currency Name:
dollar
['penny', 'nickel', 'dime', 'quarter', 'dollar']<jupyter_text>&nbsp; Task 3 `while` loop `.append()`- define an empty list: **`bday_survey`**  - get user input, **`bday`**, asking for the day of the month they were born (1-31) or "q" to finish  - using a **`while`** loop  (while user not entering "quit")  - append the **`bday`** input to the **`bday_survey`** list    - get user input, **`bday`**, asking for the day of the month they were born (1-31) or "q" to finish    - print bday_survey list<jupyter_code># [ ] complete the Birthday Survey task above
bday_survey = []

while True:
    bday = input("enter the day you were born or 'q' to quit\n")
    if bday == "q":
        print(bday_survey)
        break
    else:
        bday_survey.append(bday)<jupyter_output>enter the day you were born or 'q' to quit
12
enter the day you were born or 'q' to quit
10
enter the day you were born or 'q' to quit
8
enter the day you were born or 'q' to quit
23
enter the day you were born or 'q' to quit
1
enter the day you were born or 'q' to quit
q
['12', '10', '8', '23', '1']<jupyter_text>&nbsp; Task 4 Fix The Error<jupyter_code># [ ] Fix the Error
three_numbers = [1, 1, 2]
print("an item in the list is: ", three_numbers[2])<jupyter_output>an item in the list is:  2
{'fraction_non_alphanumeric': 0.13898460831610385, 'fraction_numerical': 0.030323914541695383, 'mean_word_length': 4.931880108991826, 'pattern_counts': {'":': 7, '<': 16, '<?xml version=': 0, '>': 17, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '32252', 'license': 'MIT', 'n_tokens_mistral': 1614, 'n_tokens_neox': 1523, 'n_words': 478, 'path': 'Python Fundamentals/Module_2_2_Python_Fundamentals.ipynb', 'repo_name': 'bperky/pythonteachingcode', 'size': '4353'}