# PART 2A result = phrase[-7] + phrase[-25] OR result = phrase[-7] + phrase[18] OR result = phrase[36] + phrase[18] OR result= phrase[36] + phrase[-25] # PART 2B result = lst[0][-2] + lst[0][7] + lst[0][-1] OR result = lst[0][-2] + lst[0][-3] + lst[0][-1] OR result = lst[0][-2] + lst[0][7]+ lst[0][9] OR result = lst[0][-2]+ lst[0][-3] + lst[0][9] OR result = lst[0][8] + lst[0][7] + lst[0][9] OR result = lst[0][8] + lst[0][7] + lst[0][-1] OR result = lst[0][8] + lst[0][-3] + lst[0][9] OR result = lst[0][8] + lst[0][-3] + lst[0][-1] # PART 2C result=phrase[3:6]+phrase[:2] OR result=phrase[3:6]+phrase[0:2] OR result=phrase[-5:-2]+phrase[-8:-6] OR result=phrase[-5:-2]+phrase[:2] OR result=phrase[-5:-2]+phrase[0:2] OR result=phrase[3:6]+phrase[-8:-6] # PART 2D result=lst[1][1]+lst[0][0] OR result=lst[-1][1]+lst[0][0] OR result=lst[-1][-1]+lst[0][0] OR result=lst[1][1]+lst[0][-2] OR result=lst[1][1]+lst[-2][0] OR result=lst[1][1]+lst[-2][-2] OR result=lst[-1][1]+lst[0][-2] OR result=lst[-1][1]+lst[-2][0] OR result=lst[-1][-1]+lst[0][-2] OR result=lst[-1][-1]+lst[-2][0] OR result=lst[-1][-1]+lst[-2][-2] # PART 2E ALL POSSIBLE SOLUTIONS BELOW. ONLY ONE IS NECESSARY result=lst[0][1][0]+lst[1][0] result=lst[0][1][-5]+lst[1][0] result=lst[0][-2][0]+lst[1][0] result=lst[0][-2][-5]+lst[1][0] result=lst[-2][1][0]+lst[1][0] result=lst[-2][1][-5]+lst[1][0] result=lst[-2][-2][0]+lst[1][0] result=lst[-2][-2][-5]+lst[1][0] result=lst[0][1][0]+lst[1][0] result=lst[0][1][0]+lst[1][-7] result=lst[0][1][-5]+lst[1][-7] result=lst[0][-2][0]+lst[1][-7] result=lst[0][-2][-5]+lst[1][-7] result=lst[-2][1][0]+lst[1][-7] result=lst[-2][1][-5]+lst[1][-7] result=lst[-2][-2][0]+lst[1][-7] result=lst[-2][-2][-5]+lst[1][-7] result=lst[0][1][0]+lst[1][-7] result=lst[0][1][0]+lst[-1][0] result=lst[0][1][-5]+lst[-1][0] result=lst[0][-2][0]+lst[-1][0] result=lst[0][-2][-5]+lst[-1][0] result=lst[-2][1][0]+lst[-1][0] result=lst[-2][1][-5]+lst[-1][0] result=lst[-2][-2][0]+lst[-1][0] result=lst[-2][-2][-5]+lst[-1][0] result=lst[0][1][0]+lst[-1][0] result=lst[0][1][0]+lst[-1][-7] result=lst[0][1][-5]+lst[-1][-7] result=lst[0][-2][0]+lst[-1][-7] result=lst[0][-2][-5]+lst[-1][-7] result=lst[-2][1][0]+lst[-1][-7] result=lst[-2][1][-5]+lst[-1][-7] result=lst[-2][-2][0]+lst[-1][-7] result=lst[-2][-2][-5]+lst[-1][-7] result=lst[0][1][0]+lst[-1][-7] # PART 2F ALL POSSIBLE SOLUTIONS BELOW. ONLY ONE IS NECESSARY result=len(lst[1][1]) result=len(lst[1][-3]) result=len(lst[-1][1]) result=len(lst[-1][-3]) # PART 2G ALL POSSIBLE SOLUTIONS BELOW. ONLY ONE IS NECESSARY result=lst[:] result=lst[0:2] result=lst[0:X] where X is any integer greater than 2 result=lst[:X] where X is any integer greater than 2 # PART 2H result="$".join(phrase.split("a")) OR ALSO ACCEPTABLE result1 = phrase.split("a") result="$".join(result) # Problem 3A def calculatePay(level, hours): if level == 'post': #calculate post pay return 25 * hours elif level == 'staff': # calculate staff pay return 35 * hours else: #calculate undergrad/grad pay if hours >= 20: return 20.0 * 15 else: return hours * 15 OR def calculatePay(level, hours): if level=="ugrad": #calculate undergrad pay if hours>20: #No more than 20 hours hours=20 rate=15 elif level=="grad": #calculate grad pay if hours>20: #no more than 20 hours hours=20 rate=15 elif level=="post": #calculate post pay rate=25 else: # calculate staff pay rate = 35 return rate*hours OR def calculatePay(level, hours): if level=="ugrad" or level=="grad": #calculate undergrad pay if hours>20: #No more than 20 hours hours=20 rate=15 elif level=="post": #calculate post pay rate=25 else: #calculate staff pay rate=35 return rate*hours OR def calculatePay(level, hours): if level=="ugrad" or level=="grad": #calculate undergrad pay if hours>20: #No more than 20 hours hours=20 rate=15 if level=="post": #calculate post pay rate=25 if level=="staff": #calculate staff pay rate=35 return rate*hours OR def calculatePay(level, hours): if level=="ugrad": #calculate undergrad pay if hours>20: #No more than 20 hours hours=20 rate=15 if level=="grad": #calculate grad pay if hours>20: #no more than 20 hours hours=20 rate=15 if level=="post": #calculate post pay rate=25 if level==”staff”: # calculate staff pay rate = 35 return rate*hours # Problem 3B def compareString(text1, text2): if text1>=text2: #text1 greater/equal lst=[text1, text2] else: lst[text2, text1] print(lst) OR def compareString(text1, text2): if text1text1: #text2 greater lst=[text2, test1] else: lst=[text1, text2] print(lst) OR def compareString(text1, text2): lst=[] if text1>=text2: #text1 greater/equal lst.append(text1) lst.append(text2) else: lst.append(text2) lst.append(text1) print(lst) OR def compareString(text1, text2): lst=[] if text2>text1: #text2 greater lst.append(text2) lst.append(text1) else: lst.append(text1) lst.append(text2) print(lst) OR def compareString(text1, text2): lst=[] if text1