''' Authors: Sohie Lee Consulted: Peter Mawhorter Purpose: Lab06 Creating list structures from given memory diagrams Date: Spring 2022 Filename: datingApps.py ''' def makeFumble0(): ''' Returns the list depicted in the memory diagram for fumble0. Uses variables to create the appropriate list structure. ''' empty = [] fumbleList = ['fumble', empty] return fumbleList def makeFumble1(): ''' Returns the list depicted in the memory diagram for fumble1. Uses variables to create the appropriate list structure. ''' client0 = ['rain', 22] client1 = ['jesse', 35] fumbleList = ['fumble', [client0, client1]] return fumbleList def makeApps0(): ''' Returns the list depicted in the memory diagram for apps0. Uses variables to create the appropriate list structure. ''' fumbleList = makeFumble1() kindlingList = ['kindling', [fumbleList[1][1]]] return [fumbleList, kindlingList] def makeApps1(): ''' Returns the list depicted in the memory diagram for apps1. Uses variables and append to create the appropriate list structure. ''' apps = makeApps0() newJesse = ['jesse',35] apps[1][1].append(newJesse) return apps # testing def test(): fumble0 = makeFumble0() fumble1 = makeFumble1() both0 = makeApps0() both1 = makeApps1() print(both0[0][1][1] is both0[1][1][0]) #True, same human print(both1[1][1][0] is both1[1][1][1]) #False, two different humans in same app