小编Tej*_*ana的帖子

None 背后的概念是什么?

当我输入错误的输入但当我输入正确的输入时,我得到 None 。它没有出现。请帮我解决这个概念。

def order():
    try:
        count = int(input("How many order ? "))
        return count
    except Exception as e:
        print("Kindly enter in numbers")
        print("Example :- 1, 2, 3, 4, 5 etc..")
    finally:
        print("Thanks to choose our service.")
choice = order()
print(choice, " will be ordered soon!!")
Run Code Online (Sandbox Code Playgroud)

输出:

How many order ? asdd
Kindly enter in numbers
Example :- 1, 2, 3, 4, 5 etc..
Thanks to choose our service.
None  will be ordered soon!!
Run Code Online (Sandbox Code Playgroud)

python

2
推荐指数
1
解决办法
42
查看次数

标签 统计

python ×1