def contains_sequence(dna1, dna2):
\'\'\' (str, str) -> bool
Return True if and only if DNA sequence dna2 occurs in the DNA sequence
dna1.
>&
According to the your Doc strings
your code:
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
This much Big code can be simplified to one line
return dna1.find(dna2)>=0
Also if u are not good with indentations in 'vim' editor its good to practice in IDLE3