Python操作符测试错题记录3

1.9//2 表达式输出结果为?

4
注意://为取整符,%为取余符

2.输出结果是什么?

x = True
y = False
z = False

if not x or y:
    print(1)
elif not x or not y and z:
    print(2)
elif not x or y or not y and x:
    print(3)
else:
    print(4)
3
注意:优先级顺序为 NOT、AND、OR。

猜你喜欢

转载自blog.csdn.net/qq_46009608/article/details/110009378
今日推荐