Question

In Python: Write a program that produces the following output when searching for the word RNA...

In Python: Write a program that produces the following output when searching for the word RNA in the paragraph below:

Output:

(RNAi) ends at position 49

(dsRNA) ends at position 211

(ssRNAs) ends at position 374

mRNAs. ends at position 431

Search Text (you can assign this to a string in your program):

"Several rapidly developing RNA interference (RNAi)

methodologies hold the promise to selectively inhibit gene expression in

mammals. RNAi is an innate cellular process activated when a

double-stranded RNA (dsRNA) molecule of greater than 19 duplex

nucleotides enters the cell, causing the degradation of not only the

invading dsRNA molecule, but also single-stranded (ssRNAs) RNAs of

identical sequences, including endogenous mRNAs."

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The code will be

s="Several rapidly developing RNA interference (RNAi) \
methodologies hold the promise to selectively inhibit gene expression in\
mammals. RNAi is an innate cellular process activated when a \
double-stranded RNA (dsRNA) molecule of greater than 19 duplex \
nucleotides enters the cell, causing the degradation of not only the \
invading dsRNA molecule, but also single-stranded (ssRNAs) RNAs of \
identical sequences, including endogenous mRNAs."

a="(RNAi)";b="(dsRNA)";c="(ssRNAs)";d="mRNAs.";

if s.find(a)!=-1:
print(f'{a} ends at position',s.find(a)+len(a))
else:
print(f'{a} not found')
if s.find(b)!=-1:
print(f'{b} ends at position',s.find(b)+len(b))
else:
print(f'{b} not found')
if s.find(c)!=-1:
print(f'{c} ends at position',s.find(c)+len(c))
else:
print(f'{c} not found')
if s.find(d)!=-1:
print(f'{d} ends at position',s.find(d)+len(d))
else:
print(f'{d} not found')

The output is

Add a comment
Know the answer?
Add Answer to:
In Python: Write a program that produces the following output when searching for the word RNA...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT