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.