Both parameters are strings representing DNA strands The two

Both parameters are strings representing DNA strands. The two strands are of equal length and only contain the four characters that represent bases. Return True if and only if the two strands form a properly base-paired DNA molecule. >>>is_dna (\"AACT\", \"TTGG\") False >>>is_dna (\"GGATC\", \"CCTAG\") True >>>is_dna (\"GCT\", \"CGA\") True >>>is_dna (\"TCATT\", \"CCGGG\") False \"\"\"

Solution

def is_dna(s1,s2):

flag=1

for i in range(len(s1)):

if s1[i] != s2[i]:

flag=0

break

if flag==1:

return true

else:

return false

 Both parameters are strings representing DNA strands. The two strands are of equal length and only contain the four characters that represent bases. Return Tru

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site