开发者

Super-annoying indent error (Python) [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its c开发者_如何转开发urrent form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

the classic unexpected indent error. Here's the relevant code. The question is how do I fix it?

    def getNum():
        firstNum = input("Please state what number to start at: ")
        secondNum = input("Please state swhat number to end at: ")
        if countingSubmenu == 3 or countingSubmenu == 4:
            thirdNum = input("Please state what increment you would want to go up by: ")
            return firstNum, secondNum, thirdNum
        else:
            return firstNum, secondNum

    if option == 1:
        getNum(firstNum, secondNum, thirdNum)
        for x in range(firstNum, secondNum+1, 1):
            print x
        print "End of test." #def getNum():


These three lines are using tabs instead of spaces:

            return firstNum, secondNum, thirdNum
        else:
            return firstNum, secondNum

You can see this pretty easily by attempting to edit the question, the tabs show up with a width of 8 spaces.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜