python practice 02
来源:互联网 发布:专业性书籍阅读软件 编辑:程序博客网 时间:2024/06/04 00:48
1. 写出python中的几种分支结构,并解释其执行过程;
(1) if:
if 表达式: #条件
语句 #输出
(2)if...else...
if 表达式: #条件
语句 #输出
else: #其他条件
语句 #其他输出
(3)if...elif...else...
if 表达式: #条件1
语句 #输出1
elif 表达式: #条件2
语句 #输出2
else:
语句 #其他输出
2. 写出python中的几种循环结构,并解释其执行过程;
(1)for循环
for i in range(m.n,x):
循环的语句 #条件
语句 #输出
(2)while循环
while 表达式(或者True,False):
循环的语句 #条件
语句 #输出
(2)while ... else .....
while 表达式:
循环语句 #条件1
语句 #输出1
else:
语句 #输出2
3. python中是否支持switch语句?如果支持,写出该语句格式;
如果不支持,说说python中怎样可以实现相同的功能;
在python里面不支持switch语句,如果想实现switch的效果,就是使用if...elif...elif...else...语句
如果支持,写出该语句格式;
如果不支持,说说python中怎样可以实现相同的功能;
编程
1.(课堂的编程) 处理字符串"1Xa7YzU",最终分别打印数字,大写字母和小写字母;
2. (复习)用户输入一个数字,判断是否为质数;
(首位为字母或下划线,其他为数字,字母或下划线)
句子反转
输入 hello xiao mi
输出 mi xiao hello
- python practice 02
- Python practice
- Python practice
- Python OOP Practice
- python practice 1
- python practice 03
- python practice 04
- Practice In Python UT & Coverage
- Good logging practice in Python
- practice
- practice
- Learn Python By Practice — 文件读写
- Python 入门教程 14 ---- Practice Makes Perfect
- [Interactive Python]Practice Exercises for Functions 解答
- Python in Practice.pdf 英文原版 免费下载
- PAT Basic level practice 02
- 神经网络与深度学习(二)- Python, Vectorization and Practice
- CodeCademy-Python Learning:Practice Makes Perfect学习笔记-“Something went wrong :(”报错
- 闲聊DNN CTR预估模型
- python学习(1)
- 错排公式详解
- 我们有自己的团队了!!!!
- sql 多个排序字段解释
- python practice 02
- 【二叉树】617. Merge Two Binary Trees
- Android 自定义View之八等份仪表盘
- 数值类型、字符串
- oracle数据库远程连接方法
- 有个女生问我“做一个APP的大致流程是什么”,我打了不少字,不舍得删,就放这里吧
- 网页编程--HTML
- sql server 2014 各版本区别
- Mac-CentOS部署JavaWeb工程