7 lines
323 B
Text
7 lines
323 B
Text
|
Nested conditional
|
||
|
if x > 10:
|
||
|
if y > 10:
|
||
|
result = "Both greater"
|
||
|
else: result = "x is greater"
|
||
|
else: result = "x is not greater" # Equivalent single conditional if x > 10 and y > 10: result = "Both greater" elif x > 10: result = "x is greater" else: result = "x is not greater"
|
||
|
function
|