Added code for lecture 2026-11-10
This commit is contained in:
parent
5b630435ae
commit
07b9e54bf0
52 changed files with 1248 additions and 1 deletions
26
lecture20261110/listmethods/list06MethodExtend.py
Normal file
26
lecture20261110/listmethods/list06MethodExtend.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
# https://www.w3schools.com/python/python_ref_list.asp
|
||||
# https://www.quackit.com/python/reference/python_3_list_methods.cfm
|
||||
|
||||
programMessage = '''
|
||||
The extend() method appends one list to another list.
|
||||
|
||||
'''
|
||||
|
||||
print(programMessage)
|
||||
|
||||
|
||||
basicList = [1, 34, 99, 87, 14]
|
||||
print(f"basicList = {basicList}")
|
||||
|
||||
myList = [111, 399, 1234]
|
||||
print(f"myList = {myList}")
|
||||
|
||||
print("\nExtending basicList with myList\n")
|
||||
|
||||
basicList.extend(myList)
|
||||
|
||||
print(f"basicList = {basicList}")
|
||||
print(f"myList = {myList}")
|
||||
|
||||
print("\n")
|
||||
Loading…
Add table
Add a link
Reference in a new issue