Python practice
来源:互联网 发布:北京知豆电动汽车4s店 编辑:程序博客网 时间:2024/06/18 18:15
Today, I learn to use the commanding prompt of python(python shell). And also practice some easy syntax in python.
Here is an easy sorting function I wrote :
num = []tot = int(input("please input the number of members:\n"))for i in range(tot): num.append(int((input())))for i in range(tot): for j in range(tot - i - 1): if num[i] > num[j + i + 1]: t = num[i] num[i] = num[j + i + 1] num[j + i + 1] = tfor i in range(tot): print(num[i])
It could be better I think, cause there are too many uncomfortable expression. which I think could be written more naturally.
阅读全文
0 0
- Python practice
- Python practice
- Python OOP Practice
- python practice 1
- python practice 02
- 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 英文原版 免费下载
- 神经网络与深度学习(二)- Python, Vectorization and Practice
- CodeCademy-Python Learning:Practice Makes Perfect学习笔记-“Something went wrong :(”报错
- Interview Practice
- [noip2015]斗地主 题解
- C++风格_友元
- 10.21离线赛
- Oracle之分区表和索引优化,分区表字段回表
- C++风格_异常
- Python practice
- java 中 问题及其他
- 随机产生两组整数,每组整数中元素互不相同,这两组数按值递增有序。设计程序,将这两组数合并成按值递减有序的一组数,要求合并的新的一组数中,相同的元素只有一个。
- tp3的单字母函数在thinkphp5.0改为助手函数简介
- Oracle学习笔记 字符集概述
- 51nod 1163 最高的奖励
- 基于TensorFlow的机器学习(1) -- 基础介绍
- Java中@Override的作用
- robots.txt