文章摘要
这篇文章主要展示了变量赋值和条件判断的逻辑流程。代码中通过赋值`a=5`和`b=20`,首先判断`a`和`b`的条件,打印了“Line 1 - Condition is true”,接着改变`a`和`b`的值为`0`和`10`,再次判断条件并打印了“Line 3 - Condition is true”和“Line 3 - Condition is not true”。最后,还通过`not(a and b)`的条件判断,打印了“Line 4 - Condition is true”和“Line 3 - Condition is not true”。文章通过具体的赋值和条件判断,突出了程序中变量值变化对逻辑判断结果的影响。
a=5
b=20
if ( a and b )
then
print(“Line 1 – Condition is true” )
end
if ( a or b )
then
print(“Line 2 – Condition is true” )
end
–lets change the value ofa and b
a=0
b=10
if ( a and b )
then
print(“Line 3 – Condition is true” )
else
print(“Line 3 – Condition is not true” )
end
if ( not( a and b) )
then
print(“Line 4 – Condition is true” )
else
print(“Line 3 – Condition is not true” )
end
© 版权声明
文章版权归作者所有,未经允许请勿转载。