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]
3 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]3 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
An information system should collect data from both external and internal sources, although organizational objectives and the ty
Andrews [41]

Answer:

True

Explanation:

An information system is the information and communication technology (ICT) that an organization uses, and also the way in which people interact with this technology in support of business processes. It is an integrated set of components for collecting, storing, and processing data and for providing information, knowledge, and digital products.

6 0
3 years ago
A systems engineer suspects a new type of malware has impacted the company network. Which threat hunting approach does the engin
Vlad [161]

Answer:

Analyze network traffic

Identify the method of execution

Explanation:

Threat Hunting is a form of cybersecurity strategy carefully formulated to recognize threats that are yet to be found by routine security monitoring.

Using the approach of Threat hunting means applying unconventional techniques to determine the threats or find the origin of the malware.

Hence, in this case, the system engineer should carry out the following steps:

1. Analyze network traffic

2. Identify the method of execution

3 0
3 years ago
When an attacker presents a program or himself as someone else to obtain private information and pretends to be a legitimate web
timofeeve [1]
A spoofing attack. "<span>a situation in which one person or program successfully masquerades as another by falsifying data, thereby gaining an illegitimate advantage."</span>
8 0
3 years ago
Need help this is for my technology class. We are doing a city research paper but it’s the rough draft and I’m doing la. But I c
serious [3.7K]
One business is " Backwards Beekeepers," Your welcome. >,<
5 0
3 years ago
Read 2 more answers
A​ _______ variable is a variable that has a single numerical​ value, determined by​ chance, for each outcome of a procedure.
7nadin3 [17]
Single variable is the answer
5 0
3 years ago
Other questions:
  • Which key removes all data from an active cell with one click
    7·2 answers
  • ________is one color shade gradually progressing to another shade of the same color or one color progressing to another color.
    14·1 answer
  • Operating systems are often written in ________, a very low-level computer programming language that allows the computer to oper
    10·1 answer
  • 50 points for each person brainless goes to the best answer
    14·2 answers
  • Consider the following constructor for an immutable matrix ADT:
    8·1 answer
  • Fill in the blanks to complete a summary of this part of the passage. For the power of Patents
    6·2 answers
  • Messages that have been accessed or viewed in the Reading pane are automatically marked in Outlook and the message subject is no
    10·2 answers
  • Direction: using the data at the left, answer the questions that follows.​
    11·1 answer
  • How many operations can a computer perform every second?
    13·1 answer
  • An online bank wants you to create a program that shows prospective
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!