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
Luba_88 [7]
2 years ago
9

Implement a program called genes.py that does the following: a. Reads a DNA sequence t as command-line argument b. Reads strings

(one by one) representing genes from standard input until EOF (use the functions stdio.isEmpty() and stdio.readString()), and for each string s i. Constructs a Gene object g from s ii. Writes g iii. Writes whether g contains the DNA sequence t or not c. Writes the percentage of genes that contain t, up to two decimal places
Computers and Technology
1 answer:
Fantom [35]2 years ago
5 0

Answer:

Following are the code to this question:

import sys#import package sys

class Gene:#defining a class Gene

   gString = ""#defining a string variable

   def __init__(self, gString):#defining a constructor

       self.gString = gString#defining object to hold string value

gCount = 0#defining integer variable

mCount = 0#defining integer variable

t = input();#input value from user end

for s in sys.stdin:#defining for loop to check input value

   g = Gene(s)#defining g variable to pass value in class parameter

   gCount +=1#incrementing the value of gCount variable

   if(t in s):#defining if block to check input

       mCount +=1#incrementing the matchCount value

       print( g.gString,"True")#print value True

   else:#else block

       print( g.gString,"False")#print value False

   print("{:.2f}".format(mCount*100/gCount))#print percentage value

Output:

Please find attachment file.

Explanation:

In the code, a class Gene is declared, that defines a string variable geneString, and creates its constructor, and store the string variable value.

In the next step, a three-variable gCount, mCount, and t defined, in which variable "t" is used for an input value, and inside the for loop, it uses the conditional statement, that checks its value and increments the integer value, and print true or false as a message.

You might be interested in
What would the range(3, 9) function generate?
gregori [183]

Answer:

A, 3,6,9

is the answer

Explanation:

bc it count by

3 0
3 years ago
One concern some users have about storing data or accessing applications in the cloud is .
andriy [413]

Answer:

Explanation:

Security is the primary concern about cloud computing. This is the main for many IT departments to refrain from using cloud computing. Some things that put the security of cloud computing to be concerned are: Theft or loss of intellectual property.

3 0
2 years ago
On which tab are import and export commands located in Access? A. Home B. Database Tools C. External Data D. Create
Ann [662]

Answer:

C. External Data

Explanation:

On the External Data tab, you can find import and export commands located in Access.

7 0
3 years ago
Tuple in Python code help pleaseee!!! And of course I'll make you as Branlist
GuDViN [60]

<u>Question 9:</u>

The correct answer would be either (b) or (d).

<u>Question 10:</u>

<u></u>

The correct answer would be (b).

Hope it helps. :)

7 0
3 years ago
There are___standard colors for text in a theme.
Stella [2.4K]
There are two standard colors for a text in a them
6 0
3 years ago
Other questions:
  • The ______ is the information center that drivers need to refer to when they're NOT scanning the road.
    13·1 answer
  • Regulatory and informational markers are easily identified through which features
    12·1 answer
  • Clicking on the sheet tab with the _______ adds another worksheet to an Excel file.
    9·1 answer
  • Tamara has $500 she is looking to save for a class trip. She wants to earn the most possible interest and will not need access t
    7·1 answer
  • Given a int variable named callsReceived and another int variable named operatorsOnCall write the necessary code to read values
    13·1 answer
  • Victor works for a telemarketing company that is on a very tight budget. He has been tasked with finding a method for the compan
    7·2 answers
  • What is essential to delivering a successful presentation?
    5·2 answers
  • <br> Help me please I need the correct answe
    10·1 answer
  • The algorithm for solving the problem of average of five (5) numbers​
    10·1 answer
  • Criminal investigations are limited to finding data defined in the search ____.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!