Question: [4 marks] Create a dictionary nucleotides from the DNA sequence 'acgtaact' where the keys are the nucleotides (a, c, g, t) and the values

[4 marks] Create a dictionary nucleotides from the DNA sequence 'acgtaact' where

[4 marks] Create a dictionary nucleotides from the DNA sequence 'acgtaact' where the keys are the nucleotides (a, c, g, t) and the values are the frequency of each nucleotide. Print the dictionary as shown in the sample output below. Notice that the output is sorted by the frequency. Your code should work for any similar DNA sequence. dna = list("acgtaact") Output: Frequency of g is 1 Frequency of c is 2 Frequency of t is 2 Frequency of a is 3 [5 marks] For each of the scenarios below, explain what data structure (Python variable type) would be the best choice and why. a. Storing pairs of names and phone numbers. b. Storing a student's age. c. Storing a patient's details (height, weight, medications, etc.) that can't be changed. d. Storing the total cost of a shopping list. e. Storing whether a date is a public holiday or not. [2 marks] Given the following variable location, give the statement to print the h in ship. location = [34, [4.5, 12, [45, 6.7, 'ship']], 'wreck'] [4 marks] Write an input-validation loop to get the cost of an apple as a valid float, then print the cost for 10 apples. Your code should produce the output below (user input follows the "Cost of an Apple: " prompt): Cost of an Apple: five :) Invalid input Cost of an Apple: Invalid input Cost of an Apple: -1 Cost must be between 0 and 3 Cost of an Apple: 5 Cost must be between 0 and 3 Cost of an Apple: 1.5 Cost of 10 Apples is $15.00

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!