class makeCode:
def __init__(self,code):
self.codeSegment = code.upper()
if checkSegment(self.codeSegment):
quit()
self.info=checkXNA(self.codeSegment)
def echo(self,start=0,stop=len(self.codeSegment),search=None): #--> self not defined
pass
Run Code Online (Sandbox Code Playgroud)
不工作......
checkSegment如果输入不是由nucleotids字母组成的字符串,或者如果包含不能在一起的nucleotids,则函数返回1;checkXNA返回带有信息"dnaSegment"或"rnaSegment"的字符串; 工作得很好.但是echo,为打印更具体的信息而设计的功能告诉我,自我没有定义,但为什么呢?
python ×1