if
: : : 2016-01-01
Python if, if else if elif if
if
if condition:
expressions
condition True, expressions
x = 1
y = 2
z = 3
if x < y:
print('x is less than y')
if x < y True, x is less than y
if x < y < z:
print('x is less than y, and y is less than z')
x < y < z, x < y and y < z, and True True python
python == =,
x = 1
y = 2
z = 3
if x = y:
print('x is equal to y')
C/C++
x = 2
y = 2
z = 0
if x == y:
print('x is equal to y')
x y 2, x is equal to y
[if ]