取消缩进错误(Python)

2024-09-29 23:25:13 发布

您现在位置:Python中文网/ 问答频道 /正文

典型的意外缩进错误。这是相关代码。问题是我如何修复它?在

    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():

Tags: tonumberinputreturnifdefwhatat

热门问题