爲什麼我在代碼下運行時遇到「無效語法」。 Python 2.7版python目標字符串鍵值無效語法
from string import *
def countSubStringMatch(target,key):
counter=0
fsi=0 #fsi=find string index
while fsi<len(target):
fsi=dna.find(key,fsi)
if fsi!=-1:
counter+=1
else:
counter=0
fsi=fsi+1
fsi=fsi+1
#print '%s is %d times in the target string' %(key,counter)
def countSubStringMatch("atgacatgcacaagtatgcat","atgc")
請修復代碼格式,使用小'101/010'按鈕 – 2010-08-19 20:36:44
-1我認爲在SO上提出問題的最低標準應該是提問者理解語言的語法,* eg *使用'def'關鍵字。 – 2010-08-20 06:02:04