shell/js/python 条件语句比较

我们来比较一下三种语言的条件语句

shell条件语句

if condition
then
    command1
    command2
    ...
    commandN
fi

javascript
if (condition) {
    command1;
    command2;
    ...
    commandN;
}

python
if condition:
    command1;
    command2;
    ....
    commandN;

shell靠then..fi标记代码块,javascript靠{},而phthon靠缩进。

原文地址:https://www.cnblogs.com/dapplehou/p/13432125.html