一、if语句
1.python 的缩进。
以冒号为界,有4个空格的缩进。在开始写代码。
2.if 语句的格式:
在Python中,if语句包含以下部分:
if 判断条件
执行语句
elif 判断条件
执行语句
else:
执行语句
三者走其一,三者是相互排斥的。
简单的例子:
print('please input you ID : ')
name = input()
if name == 'zhouyang':
print('hello zhouyang')
else:
print('miss you ID')
print('input you passwd')
passwd = input()
if passwd == '123456':
print('Access granted')
else:
print(&