diff --git a/source/week-2/collections/common-operations.py b/source/week-2/collections/common-operations.py index f5e4c9a..2d4aa6d 100644 --- a/source/week-2/collections/common-operations.py +++ b/source/week-2/collections/common-operations.py @@ -1,3 +1,18 @@ +# importing array +from array import array + +# decalare and assign arrays +scores = array('d') + +# adding items to an array +scores.append(97) +scores.append(98) +print(scores) +names = ['Christopher', 'Susan'] +print(len(names)) # Get the number of items +names.insert(0, 'Bill') # Insert before index +print(names) + names = ['Christopher', 'Susan'] print(len(names)) # Get the number of items names.insert(0, 'Bill') # Insert before index