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
How many frequencies does a full-duplex qam-64 modem use?
Vsevolod [243]

The answer is 2 frequencies.

A Full-Duplex QAM 64 K Modem uses two frequencies. One frequency is used for upstream and the other for downstream. A variety of common QAM forms are available and include, 16 QAM, 32 QAM, 64 QAM, and 256 QAM. For example, for domestic broadcast use, 64 and 256 QAM are used for cable modem and digital cable TV. The modulation scheme for this modem uses both amplitude and phase.

8 0
3 years ago
Read 2 more answers
What technology would it take to make a balloon that doesn't pop?
SpyIntel [72]
The balloon has to be made out of old truck tiers at lest 20 ilb
7 0
3 years ago
AFLAC, Inc. recently implemented a company policy that all new IT projects must be coordinated and approved by the project manag
Shkiper50 [21]

Answer:

Option (E) is the correct answer to the following question.

Explanation:

Because it helps AFLAC Inc. company to run their project in a more easier way and it also helps its employees to work fast on their new IT projects by installing a WiFi network in their ALFAC inc. branch office. So, that's why they have to install a wireless network.

And the other option is not applied because these activities have to be done in all projects if the project is important either not.

8 0
3 years ago
By definition, a computer
lapo4ka [179]

Answer has a screen

Explanation:

a computer has a screen

5 0
2 years ago
Write a python program to find the Area of Circle!<br>GRADE 8 CBSE​
barxatty [35]

Answer:

PI = 3.14

radius = float(input(' Please Enter the radius of a circle: '))

area = PI * radius * radius

circumference = 2 * PI * radius

Explanation:

i srs dont know i am so sorry i forgot but maybe this?

6 0
2 years ago
Other questions:
  • 1. What are the biggest risks when using the public Internet as a Wide Area Network (WAN) or transport for remote access to your
    6·1 answer
  • When using a template to compose a memorandum which key on the keyboard moves the cursor to the next field
    15·1 answer
  • Explain the use of keyboard shortcuts and key combinations. You are at the tenth page of a 20-page document. You need to make ch
    14·1 answer
  • Could someone please explain to me the an electrical circuit.
    13·2 answers
  • Which of the following is an advantage of using variables?
    9·1 answer
  • In binary, the second digit from the right is multiplied by the first power of two, and the _____ digit from the right is multip
    10·2 answers
  • Question 1 (1 point)
    5·2 answers
  • FIRST TO Answer for free brainlest. GOG GOGOGO
    6·1 answer
  • A write the result P*=++j where j is 24
    5·1 answer
  • Many people are scared of the rise of Artificial Intelligence (AI). Do you think computers that are controlled by an AI are some
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!