def contains_sequence(dna1, dna2):
''' (str, str) -> bool
Return True if and only if DNA sequence dna2 occurs in the DNA sequence
dna1.
>>> contains_sequence('ATCGGC', 'GG')
True
>>> contains_sequence('ATCGGC', 'GT')
False
'''
b=False
len2=len(dna2)
i=0
for j in dna1:
temp=dna1[i:i+len2]
if temp == dna2:
b=True
i=i+1
return b
I am new to Python. The program pasted above gives me an error "Inconsistent use of tabs and spaces in indentation" at line "if temp == dna2:" specifically. Can someone please help me out in finding out how the indentation is incorrect?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…