## ## do not remove the extra print statements print('Question 1') ################################################################# # QUESTION 1 # # # Write a for-loop with a corresponding range function to # compute the sum of the first 100 natural numbers. In other words, # using the for-loop compute the sum of 1 + 2 + 3 + ... + 100 # # **your answer should use a for-loop. You will get 0 points if # you do not use a for-loop. # # Your output should be a single line stating "The sum of the # first 100 natural numbers is: " followed by the result. # # ################################################################# ## add code for question 1 here ## do not remove the extra print statements print('Question 2') ################################################################# # QUESTION 2 # # # Using a while-loop, create a list that has the same contents # as this range function output: # # >>> list(range(3,26,4)) # [3, 7, 11, 15, 19, 23] # # **your answer should use a while-loop. You will get 0 points if # you do not use a while-loop. # # Your output should be a single line with the correct list. # # ################################################################# ## add code for question 2 here ## do not remove the extra print statements print('Question 3') ################################################################# # QUESTION 3 # # # For the following string variable RNA, loop through all the # matches to AUG, print out each sequence that starts with AUG # (including the AUG itself) along with the remaining sequence # to the end. # # RNA = 'GCACGACGAUGGAUGCAUGUCUGACUAGCUGAUCGACGAUGCACGUCAGCACUGACUGAUGACGACU' # # Your output should consist of one sequence per line, each # starting with 'AUG'. # # ################################################################# RNA = 'GCACGACGAUGGAUGCAUGUCUGACUAGCUGAUCGACGAUGCACGUCAGCACUGACUGAUGACGACU' ## add code for question 3 here ## do not remove the extra print statements print('Question 4') ################################################################# # QUESTION 4 # # # For the following DNA sequence, create a new string that is the # string concatenation of two substrings. The first substring # should begin at (0-based) index 15 and be of length 5. The second # substring should be the reverse of the sequence starting at # (0-based) index 20 and going up to and including index 31. # # DNA = 'TGTTCGTTCTGCCTGCGGTTGGTGCAACACTAACAGCAACAGCAGTGTCGAGAAAAAGCGGGAAATCCAACCTT' # # Your output should be a single line with just the requested # output string. # # ################################################################# DNA = 'TGTTCGTTCTGCCTGCGGTTGGTGCAACACTAACAGCAACAGCAGTGTCGAGAAAAAGCGGGAAATCCAACCTT' ## add code for question 4 here ## do not remove the extra print statements print('Question 5') ################################################################# # QUESTION 5 # # # For the following tuple, convert it to a list, then modify the # element 'candy' and replace it with 'celery', and then convert # it back to a tuple with the same variable name. # # shopping_cart = ('apples','bread','candy') # # Your output should be a single line with the tuple printed out. # # # ################################################################# shopping_cart = ('apples','bread','candy') ## add code for question 5 here ## do not remove the extra print statements print('Question 6') ################################################################# # QUESTION 6 # # # Transcription without the replace() method # # DNA is similar to RNA, but 'T' is replaced with 'U'. # # For the following DNA sequence, convert it to RNA using a for-loop. # Your for-loop must traverse each character of the DNA sequence # and concatenate to the RNA sequence: if the DNA character is a # 'T' you should concatenate a 'U' to the RNA sequence, otherwise # concatenate the original DNA character. # # **your answer should use a for-loop and not use the replace() # method (you will get 0 points if you use replace function). # # Hint: You need to use an if and else loop to confirm each # character in the for loop. # # DNA = 'TGTTCGTTCTGCCTGCGGTTGGTGCAACACTAACAGCAACAGCAGTGTCGAGAAAAAGCGGGAAATCCAACATCGCGTCGCCTAAG' # # Your output should be the RNA string on a single line. # # # ################################################################# DNA = 'TGTTCGTTCTGCCTGCGGTTGGTGCAACACTAACAGCAACAGCAGTGTCGAGAAAAAGCGGGAAATCCAACATCGCGTCGCCTAAG' RNA = '' ## add code for question 6 here ## do not remove the extra print statements print('Question 7') ################################################################# # QUESTION 7 # # # Using the range function and list concatenation, create the # following list (in the same order as shown): # # [5, 8, 11, 14, 17, 20, 22, 24, 26, 28] # # Your output should consist of the correct list on a single line. # # # ################################################################# ## add code for question 7 here