Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information. >>> myItems={} >>> type(myItems) >>> anotherIntem=dict() >>> type(anotherIntem) >>> myItems["glass"]=1.79 >>> myItems["reem of paper"]=5.95 >>> myItems {'glass': 1.79, 'reem of paper': 5.95} >>> "book" in myItems False >>> "glass" in myItems True >>> myItems.keys() dict_keys(['glass', 'reem of paper']) >>> myItems.values() dict_values([1.79, 5.95]) >>> myItems.get("glass") 1.79 >>> myItems["book"]=19.95 >>> myItems["cd"]= 9.95 >>> myItems {'glass': 1.79, 'reem of paper': 5.95, 'book': 19.95, 'cd': 9.95} >>> del myItems["reem of paper"] >>> myItems {'glass': 1.79, 'book': 19.95, 'cd': 9.95} >>> for item in myItems: print(item) glass book cd >>> for item in myItems: print(item,"cost me",myItem[item]) Traceback (most recent call last): File "", line 2, in print(item,"cost me",myItem[item]) NameError: name 'myItem' is not defined >>> for item in myItems: print(item,"cost me",myItems[item]) glass cost me 1.79 book cost me 19.95 cd cost me 9.95 >>> myItems.clear() >>> myItems {} >>> myList=[1,5,10,20,2,4,6] >>> myList.append(255) >>> myList [1, 5, 10, 20, 2, 4, 6, 255] >>> anotherList = [1,2,3,4,5] >>> myList+anotherList [1, 5, 10, 20, 2, 4, 6, 255, 1, 2, 3, 4, 5] >>> myList.append(anotherList) >>> myList [1, 5, 10, 20, 2, 4, 6, 255, [1, 2, 3, 4, 5]] >>> result = myLIst.remove([1,2,3,4,5]) Traceback (most recent call last): File "", line 1, in result = myLIst.remove([1,2,3,4,5]) NameError: name 'myLIst' is not defined >>> result = myList.remove([1,2,3,4,5]) >>> >>> result >>> myList [1, 5, 10, 20, 2, 4, 6, 255] >>> myList.append(100) >>> myList [1, 5, 10, 20, 2, 4, 6, 255, 100] >>> result = myList.pop(100) Traceback (most recent call last): File "", line 1, in result = myList.pop(100) IndexError: pop index out of range >>> result=myList.pop(-1) >>> result 100 >>> myList [1, 5, 10, 20, 2, 4, 6, 255] >>> myList.append(2) >>> myList.append([2,4,6]) >>> myList [1, 5, 10, 20, 2, 4, 6, 255, 2, [2, 4, 6]] >>> myList.count(2) 2 >>> mtList.insert(3,15) Traceback (most recent call last): File "", line 1, in mtList.insert(3,15) NameError: name 'mtList' is not defined >>> myList.insert(3,15) >>> myList [1, 5, 10, 15, 20, 2, 4, 6, 255, 2, [2, 4, 6]] >>> myLIst.index(15) Traceback (most recent call last): File "", line 1, in myLIst.index(15) NameError: name 'myLIst' is not defined >>> myList.index(15) 3 >>> myList.index(2) 5 >>> myList.sort() Traceback (most recent call last): File "", line 1, in myList.sort() TypeError: '<' not supported between instances of 'list' and 'int' >>> myList [1, 2, 2, 4, 5, 6, 10, 15, 20, 255, [2, 4, 6]] >>> myList.sort() Traceback (most recent call last): File "", line 1, in myList.sort() TypeError: '<' not supported between instances of 'list' and 'int' >>> myList.reverse() >>> myList [[2, 4, 6], 255, 20, 15, 10, 6, 5, 4, 2, 2, 1] >>> myList.remove([2,4,6]) >>> myList [255, 20, 15, 10, 6, 5, 4, 2, 2, 1] >>> myList.sort() >>> myList [1, 2, 2, 4, 5, 6, 10, 15, 20, 255] >>>