|
c/c++ |
python |
shell |
java |
1. 顺序 |
command1;
command2;
|
command1
command2
|
command1;
command2;
|
command1
command2
|
2. 分支 |
if(condition_if){
commands_if;
} else { // 可选
commands_else;
}
|
if(condition_if1){
commands_if1;
} else if (condition_if2) {
commands_if2;
} else{ //可选
commands_else;
}
|
switch (condition){
case case1:
comands_1;
break; // 可选
case case2:
comands_2;
break; // 可选
default:
commands_default;
}
|
|
if condition_if:
commands_if
else: # 可选
commands_else
|
if condition_1:
commands_1;
elif condition_2:
commands_2
else: # 可选
commands_else
|
|
|
|
3. 循环 |
|
|
|
|
4. 块 |
|
|
|
|
5. 函数 |
|
|
|
|
6. 类 |
|
|
|
|
7. 模块 |
|
|
|
|
8. 包 |
|
|
|
|
标签:command1,commands,command2,if1,编程,else,语法,condition
来源: https://www.cnblogs.com/ai-tech/p/15225080.html