1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Dafna1 [17]
3 years ago
7

Create your own Python file in a code editor of choice and begin writing functions as defined below. Your function names, inputs

, and outputs should be exactly as described. Please make sure you follow the coding guidelines from the main rubric! def dna_count(dna): This function takes in a string representing a DNA sequence and returns a list or tuple of four integers representing the number of times each nucleotide A, C, G, or T occur in the DNA string, in that order.
Biology
1 answer:
hoa [83]3 years ago
3 0

Answer:

In python:

def dna_count(dna):

   A = dna.count('A');    C = dna.count('C')

   G = dna.count('G');    T = dna.count('T')

   dna_countlist = []

   dna_countlist.append(A)    dna_countlist.append(C)

   dna_countlist.append(G)    dna_countlist.append(T)

   return dna_countlist

   

dna = input("DNA: ")

print(dna_count(dna))

Explanation:

This defines the function

def dna_count(dna):

This counts the occurrence of A and C

   A = dna.count('A');    C = dna.count('C')

This counts the occurrence of G and T

   G = dna.count('G');    T = dna.count('T')

This creates an empty list

   dna_countlist = []

This appends the occurrence of A and C to the empty list

   dna_countlist.append(A)    dna_countlist.append(C)

This appends the occurrence of G and T to the list

   dna_countlist.append(G)    dna_countlist.append(T)

This returns the list

   return dna_countlist

The main begins here

This prompts the user for the DNA string

dna = input("DNA: ")

This calls the dna_count function and also prints the returned list

print(dna_count(dna))

You might be interested in
Which is not a use for fossils found in sedimentary rocks?
Talja [164]
Answer is D Whereas theDepartment of Defense is charged with military actions abroad, theDepartment of Homeland Security works in the civilian sphere to protect the United States within, at, and outside its borders. Its stated goal is to prepare for, prevent, and respond to domestic emergencies, particularly terrorism.
5 0
3 years ago
Read 2 more answers
Which is an indication that water is entering cells
MAVERICK [17]
The cell would become turgid or swollen, in plant cells, the cell wall prevents the cell from bursting whereas in animal cells, the cell would burst, if that makes any sense
4 0
3 years ago
Which of the following terms applies to hydrogen sulfide
Ivahew [28]

Hydrogen Sulfide (H2S) Hydrogen sulfide is a colorless, flammable, extremely hazardous gas with a “rotten egg” smell. It occurs naturally in crude petroleum and natural gas, and can be produced by the breakdown of organic matter and human/ animal wastes (e.g., sewage).



so a

8 0
3 years ago
Which of the following is used up during cellular respiration
Rasek [7]
C is the answer because water and carbon dioxide are left over after and mitochondria is the thing in the cell that converts everything.
4 0
4 years ago
On early Earth, what was referred to as the \"primordial soup\"?. A) The mixture of gasses in the early Earth's atmosphere. B) T
harina [27]
On early earth, the one that was referred to as "Primordial Soup" is : B. The combination of organic compounds in warm salty water

Many speculated that these organic compounds mutated and evolved into a single cell organism, which became the origin of the organisms on earth

hope this helps
5 0
3 years ago
Other questions:
  • An ecologist is studying Dunaliella Salina a single celled algae in a local pond. The con is located near construction site in t
    6·1 answer
  • Which of these has led to the production of most modern domesticated crops and livestock
    8·2 answers
  • Gene flow is the movement of genes across barriers such as mountains, oceans, or deserts. These barriers are usually natural. Ho
    14·2 answers
  • What type of virus uses RNA , and not DNA, as its genetic material?A. Retroviruses. B. Parvoviruses. C. Adenoviruses. D. Bacteri
    11·2 answers
  • What are the differences between a prokaryotes and eukaryotes?
    9·2 answers
  • What is a clear substance made of only one kind of atom?
    7·1 answer
  • "Could you please help me? I have a question that is honestly NOT a homework
    14·1 answer
  • Duck-billed platypus is called a bridge animal, why?​
    10·1 answer
  • Which of the following statements is correct about air temperature?
    7·2 answers
  • What happens over time to the temperature of the CO2 as sunlight is shining on it? Why?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!