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
Whos really watching this guys bruh​
Ivahew [28]

Answer:

Me no

Explanation:

4 0
3 years ago
Read 2 more answers
Name box _________. a. Used to move horizontally or vertically within a worksheet b. A group of selected cells c. The cell refer
MA_775_DIABLO [31]

Answer:

The answer is "Option c".

Explanation:

The name box is a part of the Microsoft Excel, that provides an input box on the left side of the formula row, which is usually shown on the "working cell" address on the worksheet. It can also use the name box is to easily switch to any location in the Worksheet, and wrong choices can be described as follows:

  • In option a, It is used in worksheet but it's not a worksheet.
  • In option b, It can't select cells.
  • In option d, It is used to input a value not to identify the program.

5 0
2 years ago
Hey there everyone, i have a technology class assignment and it is to get 200 subs on YT... it counts as assessment grade and i
VikaD [51]

Answer:

You have support

Explanation:

I hate it when our classes do this, i had this exact assignment a while back :/

Nice dominoes you got there. Very creative! : D

4 0
3 years ago
PLEASE HELP WILL MARK AS BRAINLIEST
Katena32 [7]

Answer:

Manufacturing

Explanation:

Planning. Data plots on all things and future plans as in if how much is bought what prices of stock you will have. Person could improve by taking courses in business planning.

3 0
2 years ago
Match each feature to whether it influences audio or video quality
maw [93]

Answer:

Video: Frame Rate, Color depth, Resolution

Audio: Sampling Rate, Bit Depth

Explanation:

7 0
3 years ago
Other questions:
  • 1. To type a capital "C", you would use the ring finger of your left hand.
    15·2 answers
  • 1.where should the name of the website or company logo appear on a website
    5·2 answers
  • Audio editing software contains several codecs that allow you to
    15·1 answer
  • You’ve been stuck in bumper-to-bumper traffic for nearly an hour on a hot summer day. The temperature warning light has just com
    7·1 answer
  • Is science fiction always set in the future
    14·1 answer
  • Differentiate between the broadcasting and telecommunication
    5·1 answer
  • In the SDLC's third phase, the way in which a proposed information system will deliver the general abilities described in the pr
    7·1 answer
  • Most printers are plug and play compatible and must be manually configured when they are plugged into the system.
    14·2 answers
  • Which of these is not a valid form<br>layout in Microsoft Access?​
    11·1 answer
  • Technical skills are also called soft skills.<br> Question 9 options:<br> True<br> False
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!