## Programming Assignment #3 ## do not remove the extra print statements print('Question 1') ################################################################# # QUESTION 1 # # Using the range function, define two lists. The first one # # will contain the even integers from 0 to 20 (inclusive). The # # second list will contain the odd integers from 1 to 21 # # (inclusive). By inclusive I mean it should include the last # number provided above (20 for list 1, 21 for list 2). # # # Next use the zip() function to zip these two lists, creating # # a list of tuples. Print the resulting list of tuples as a list # which should print it all on one line. ################################################################# ##add code for question 1 here ## do not remove the extra print statements print('Question 2') ################################################################# # QUESTION 2 # # Given the tuple below, convert it to a list, then change the # # term indexed by 2 (homework) to the word "pumpkin". Finally, # # convert the modified list back to a tuple and print it out. # # # ################################################################# ##add code for question 2 here halloween_tuple = ("ghost","ghoul","homework","jack-o-lantern","skeleton","trick","treat","candy") ## do not remove the extra print statements print('Question 3') ################################################################# # QUESTION 3 # # # # First, convert these two tuples into lists. # # Next, add 'RNA' to the end of list A, and add 'CGUUAC' to the # # end of list B. Zip them together and print out the resulting # list of tuples. It should be printed on line when printed # directly as the list # # ################################################################# ##add code for question 3 here A = ('DNA', 'RNA ', 'Protein') B = ('ATCGATCGA', 'AUCGAUCGA', 'IDR') ## do not remove the extra print statements print('Question 4') ################################################################# # QUESTION 4 # # # # Use the zip() function to zip these two lists below and # # create a dictionary. Print out the resulting dictionary. ################################################################# ##add code for question 4 here A = ['DNA', 'RNA ', 'Protein'] B = ['ATCGATCGA', 'AUCGAUCGA', 'IDR'] ## do not remove the extra print statements print('Question 5') ################################################################# # QUESTION 5 # # Given the list defined by this use of the range function, how # # would you extract the sublist, that gives the following # # result [3,7,11,15] # # # # The output of the provided range command below is this: # # # # [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] # # # Please define a sublist that extracts [3,7,11,15] from the # provided list L, and print out your sublist. ################################################################# ##add code for question 4 here L = list(range(2,17,1))