x=1
y=2
z=3
if x<y:
print('x is less than y')
if x<y<z:
print('x is less than y and y is less than z')
if x!=y:
print('x is not equal to y')
if y>z:
print( 'y>z')
elif y==z:
print('y=z')
else:
print('y<z')
if x<y:
if y<z:
print('x<y<z')
else:
print('x<y but y>=z')
Python if语句
最新推荐文章于 2020-12-05 04:14:12 发布