Skip to content

Latest commit

 

History

History
executable file
·
34 lines (27 loc) · 509 Bytes

File metadata and controls

executable file
·
34 lines (27 loc) · 509 Bytes

条件判断

基本知识介绍

if 条件判断1:
    执行1
elif 条件判断2:
    执行2
elif 条件判断3:
    执行3
else:
    执行4

也就是说没有 else if 它使用的是elif

简写if
if x:
    print('内容是~~~')

ps:没有;跟go一样,和命令前不要加空格。

⚠️

在Python中并没有 || 和 && 取而代之的是

Python 一般程序语言
or p
and &&