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
Management of software development consist of?
JulsSmile [24]

Answer:

d. All of the above

Explanation:

A software can be defined as a set of executable instructions (codes) or collection of data that is used typically to instruct a computer how to perform a specific task and to solve a particular problem.

A software development life cycle (SDLC) can be defined as a strategic process or methodology that defines the key steps or stages for creating and implementing high quality software applications.

In Computer science, management of software development consist of;

a. Process: it involves the stages through which a software application is analyzed, designed, developed, tested, etc.

b. People: it refers to the individuals involved in the software development process.

c. Project: it's the entirety of the stages a software goes through before it gets to the end user.

5 0
2 years ago
There are many careers within the IT industry. _____ are responsible for organizing a company's data, making sure all the data i
devlian [24]
C. database administrators are responsible for organizing a company's data making sure all the data is accurate' available' and secure
5 0
2 years ago
Select the best answer to the following question.
Fittoniya [83]

Answer:

I think its called "cloud computing"

8 0
2 years ago
A paradigm innovation occurs when:
Viktor [21]
B. Because major shifts in thinking can cause change.
4 0
3 years ago
What is the legal right granted to all authors and artists that gives them sole ownership and use of their words, software, pict
ICE Princess25 [194]

Answer:

copyright

Explanation:

3 0
3 years ago
Other questions:
  • When planning the structure of a spreadsheet, columns are for _______ items and rows are for _______ items.
    5·2 answers
  • PLEASE HELP!<br> How do you "brainliest" an answer?
    13·2 answers
  • Consider a binary-search method in an array that reports whether an object is in the array. The documentation indicates that the
    11·1 answer
  • John was carrying on at the water cooler the other day, trying to show off his knowledge of networking. He claimed that the comp
    10·1 answer
  • What is "the last mile of broadband access"? Why is this a problem and what kind of impact does it have on the business world an
    9·1 answer
  • Select the correct answer. Vlad wants to include his goals and target in his résumé. He also wants to add how he can be benefici
    12·1 answer
  • . Write a C++ Code to get a multiline statement Str1 from a user with a ‘$’ as return character (Hint:
    6·1 answer
  • Please anyone, help me.... I'm not sure how to put these all together.<br> 35 points!
    15·2 answers
  • What is the output of:<br><br> print (8 % 4)
    6·1 answer
  • What are your strongest competencies? What will you do them? <br>❌NONSENSE ANSWER<br>​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!