에서 연습하고 난 다음 얻을
위에 나는대로 class Talker:
를 입력으로 나는 최대한 빨리오류가 나는 파이썬에 새로운 오전 터미널
>>> class Calculator:
... def calculate(self,expression):
... self.value=eval(expression)
... class Talker:
을 다음 쓴 터미널
서면 클래스를 연습하고 오류
File "<stdin>", line 4
class Talker:
^
IndentationError: unindent does not match any outer indentation level
왜이 들여 쓰기 오류가 발생하는지 이해할 수 없습니까? 여기에서 어떻게 진행해야합니까? 내가 오류를 수정하고 지금은이
class Calculator:
... def calculate(self,evaluate):
... self.value=eval(expression)
... class Talker:
... def talk(self):
... print 'Hi, my value is ', self.value
... class TalkingCalculator(Calculator,Talker):
... pass
...
가 지금은 오류
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 4, in Calculator
File "<stdin>", line 7, in Talker
NameError: name 'Calculator' is not defined
내가 여기에 놓친 한 일이 오류가 무엇을 얻을 다음 썼다
업데이트를 기반으로
?
'class talker' 한 칸을 들여 썼습니다. 들여 쓰기를하지 마십시오. –
나는 당신이 당신의 코멘트를보고 난 후에 무엇을 제안했지만 나는 오류 파일 ""라인을 가지고 4 클래스 전병 : ^ 구문 에러 : 유효하지 않은 구문 –
왜이 질문이 아래로 –