python中的分支有三种形式,分别是:
1、if
#!/usr/bin/env python #-*- coding:utf-8 -*- user=input('Please input your username : ') if user=='admin':5 print('Nice')
2、 if … else …
#!/usr/bin/env python #-*- coding:utf-8 -*- user=input('Please input your username : ') pass=input('Please input your password: ') if user=='admin' and pass=='123456': print('Good') else: print('Bad')
3、if … elif … else …
#!/usr/bin/env python #-*- coding:utf-8 -*- grade=(prompt='Please input your grade') if grade>=85: print('Great') elif garde<85 and grade>=70: print('Good') else grade<70: print('Bad')
神龙|纯净稳定代理IP免费测试>>>>>>>>天启|企业级代理IP免费测试>>>>>>>>IPIPGO|全球住宅代理IP免费测试