#1 #a) def Unknown(x, y): if x < y: print(str(x+y)) return input((Unknown(x+1, y) * 2)) elif x == y: return 1 else: print(str(x+y)) return int((Unknown(x-1,y)/2)) #b print('10 and 15') print(str(Unknown(10,15))) print('10 and 10') print(str(Unknown(10,10))) print('15 and 10') print(str(Unknown(15,10))) #ii) #won't print right #c def IterativeUnknown(x,y): #base case Total = 1 while x != y: print(str(x+y)) if x < y: x = x + 1 Total = Total * 2 else: x = x - 1 Total = Total / 2 return print('10 and 15') print(str(IterativeUnknown(10,15))) print('10 and 10') print(str(IterativeUnknown(10,10))) print('15 and 10') print(str(IterativeUnknown(15,10))) #d screenshot result #2 #a class Picture(): def __init__(self, DescriptionP, WidthSizeP, HeightSizeP, FrameColourP): self.__Descripti self.__WidthSize = WidthSizeP self.__HeightSize = HeightSizeP self.__FrameColour = FrameColourP #b def GetDescription(self): return self.__Description def GetHeight(self): return self.__HeightSize def GetWidth(self): return self.__WidthSize def GetColour(self): return self.__FrameColour #c def SetDescription(self, description): self.__Descripti #d Array = [None] * 100 #TYPE Picture #e def ReadData(Array): Count = 0 try: file = open('Pictures.txt', 'r') Descripti while Description != '': Width = int(file.readline().strip()) Height = int(file.readline().strip()) Frame = int(file.readline().strip()) myObject = Picture(Description,Width,Height,Frame) #here Count Count + 1 file.close() except IOError: print('File not found') return Count #f #call the function ReadData() ReadData(Array) #here #g UserEnteredColour = input('Enter your color requirements for the picture') UserEnteredMaxWidth = input('Enter your maximum width requirements for the picture') UserEnteredMaxHeight = input('Enter your maximum height requirements for the picture') for element in Array: if UserEnteredColour == element.GetColour() and UserEnteredMaxWidth == element.GetWidth() and UserEnteredMaxHeight == element.GetHeight(): #the getters r not self completing here when using element print(UserEnteredColour) print(UserEnteredMaxWidth) print(UserEnteredMaxHeight