-1
저는 파이썬에서 초보자입니다. Python 오류 함수 내에서 함수 호출
File "first.py", line 11
first(7)
^
IndentationError: unexpected indent
내가
What to do with "Unexpected indent" in python? 읽을 수 있지만 내가 오류를 찾을 수 없습니다 : 나는 오류가
import sys
def first(n):
print "Hi Man"+" Huuuuuu"
if len(sys.argv)>1: print sys.argv[1]
def second():
print "Huuuuuuuuuuu"
first(7)
if __name__=='__main__':
second()
: 난 그냥 안녕하세요 프로그램을 확장했다.
나는 파이썬 -t 명령을 실행 : 당신의 도움에 대한python -t first.py
first.py: inconsistent use of tabs and spaces in indentation
File "first.py", line 12
first(7)
^
IndentationError: unexpected indent
감사합니다.
코드를 복사하여 오류가 없습니다. 공유 한 코드가 실행중인 코드와 정확히 일치합니까? –
4 개의 공백과 탭을 사용하지 않았는지 확인하십시오. – Eduard
코드 12 줄에 들여 쓰기 오류가 거의 발생합니다 (따라서 IndentationError). 함수 내에서 함수를 호출하는 것은 문제가 아닙니다. 들여 쓰기를 수정하십시오. – Michael