if 条件:
内容一
内容二
else:
内容三
内容四
例(1): n1 = 1 n2 = 2 if n1 < n2: print('yes') else: print('no')
例(2): name = input('请输入L') if name == 'L': print('Yes') else: print('No')
name = input('请输入账号:') mima = input('请输入密码:') if name == 'L' and mima == '123': print('hello word') elif name == 'M' and mima == '123': print('Be') else: print('No') 条件: True False 1>2 n1>2 n1 == n2 name == 'L' or name == 'M' name != 'L' name == 'L' and nima == '123'