shell:


Python:


注意:
1.shell中[ expression ]中的expression必须与[]保持空格,否则会报错;并且if也要与[]之间保持空格
2.shell中的if /if else/ if elif语句中if或者elif后面都必须加then,else后面不需要加then;最后面都必须是fi
3.Python中if后面没有 [ ] ,但是表达式后面有 : 并且python没有then,没有if
shell:
Python:
注意:
1.shell中[ expression ]中的expression必须与[]保持空格,否则会报错;并且if也要与[]之间保持空格
2.shell中的if /if else/ if elif语句中if或者elif后面都必须加then,else后面不需要加then;最后面都必须是fi
3.Python中if后面没有 [ ] ,但是表达式后面有 : 并且python没有then,没有if
本文标题:shell&python中的if else语句
本文链接:https://www.haomeiwen.com/subject/zucilftx.html
网友评论