python中的分支有几种形式
发布时间:2021-02-03 编辑:jiaochengji.com
教程集为您提供python中的分支有几种形式等资源,欢迎您收藏本站,我们将为您提供最新的python中的分支有几种形式资源
【相关学习推荐:python教程】
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')
您可能感兴趣的文章:
python中的分支有几种形式
初识Python-Python的历史与优缺点
Python的特点(优点和缺点)
python编程软件有什么
简单介绍下python2.x与python3.x的区别
Python数值类型(整形、浮点型和复数)及其用法
python数据分析用什么软件
python图形界面开发用什么
学python一定要学django吗
学习Python却没看过这几本书,你就OUT了
上一篇:python如何制作网页
下一篇:如何使用python运行文件
[关闭]