ord()  函数 和 chr()  相反   chr() 是将数字转换成assci码     ord() 是将字符串转换成assci码 显示

pow() 函数  pow(x,y,z)  表示x**y%z  取商。   如果是pow(x,y)   表示x**y

例如:  print(pow(2,3)) print(pow(2,3,2)) 输出: 8 0

reverse()    函数   翻转,将一个列表进行掉头。例如:

 num = [1,2,3,4,5,6,7,8,9]
num.reverse()
print(num)
输出:
[9, 8, 7, 6, 5, 4, 3, 2, 1]

round() 四舍五入

slice() 定义切片的规则  例如:

 a = "hello"
s1 = slice(3,5)
print(a[s1])
输出:
lo

可以提前定下规则,方便以后的阅读代码

还可以指定步长,例如:

 a = "abcdefghijklmnopqrstuvwxyz"
s1 = slice(3,11,2)
print(a[s1])
输出:
dfhj

最新文章

  1. ajax携带状态值
  2. java项目报junit 相关错误
  3. bzoj1201: [HNOI2005]数三角形
  4. BOOST的AUTO link机制以及配置
  5. SQL中CONVERT()转化函数的用法 字符串转日期
  6. Python基本程序结构
  7. A题笔记(11)
  8. linux内核--进程地址空间(三)
  9. POJ1836 Alignment(LIS)
  10. springMVC3学习(八)--全局的异常处理
  11. Windows 10 IoT Core环境配置中的那些坑
  12. 使用webpack热加载,开发多页面web应用
  13. libGDX-wiki发布
  14. VMware workstation创建虚拟机console
  15. 长短时记忆网络LSTM和条件随机场crf
  16. 3ds max学习笔记(十)-- 实例操作(镜像和对齐)
  17. Eclipse出现:An internal error occurred during: "Retrieving archetypes:". GC overhead limit exceeded的问题解决
  18. .NET MVC5+ Dapper+扩展+AutoFac自动注入实现
  19. Python3之socket编程
  20. [LeetCode&Python] Problem 136. Single Number

热门文章

  1. 进程,内存,管理 ps,pstree,top,free,vmstat,iftop,lsof,查看网速
  2. Cisco AP-如何调整LAP信道
  3. office365激活码序列号密钥:
  4. 从零构建以太坊(Ethereum)智能合约到项目实战——学习笔记10
  5. 四阶幻方-蓝桥杯-DFS
  6. Python数据类型-7 bytes
  7. 建小程序 - 报Error: EPERM : operation not permitted, scandir mac下改变一个目录的访问权限
  8. linux中cp指令前面加反斜杠
  9. 使用eclipse搭建springboot项目pom.xml文件第一行报错(Maven Configuration Problem)
  10. centos6.5安装图形操作界面