Skip to main content
 首页 » 编程设计

python之需要帮助来理解 python 中的代码

2024年11月01日8tintown

<分区>

first = int(input('first int: ')) 
second = int (input('second int: ')) 
result =0 
if first and second: 
result =1 
elif not first: 
    result =2 
elif first or second: 
    result=3 
else: 
    result=4 
print(result) 

当我输入 1 和 0 时,结果是 3。如果有人能补充一些解释,我将不胜感激。