Python Tips
来源:互联网 发布:mac os系统简介 编辑:程序博客网 时间:2024/06/05 05:44
- 使用 type 前,先 import types
- Python 里面字符串转整型 int,是直接转成对应数字而没有
+48
,另外只允许a = int(a)
的写法而不允许a = (int)a
- 在 function 中不改变整个 list 而改变 list 中的某些值,可以不用
global
- shuffle 函数用来随机 list.
random.shuffle(list)
- list 的 + 和 * 操作
- a = range(8) + range(8)
- a = range(8) * 2
- b = [False] * 16
- 多项赋值语句合并。
a, b = 1, 2
- return 可以 return 多个值
阅读全文
0 0
- python tips
- Python tips
- python tips
- Python Tips
- python tips
- python tips
- Python tips
- Python Tips
- Python Tips
- Python-Tips
- Python Tips
- Python Tips & Tricks
- Python小tips
- Python Tips (1)
- Python Performance Tips
- python tips(1)
- python tips(2)
- python tips(3)
- sklearn 特征提取
- git入门命令及合作技巧
- hdu 1008 非常可乐 bfs
- 在ubuntu下如何搜索文件?
- [bzoj4326][NOIP2015] 运输计划 差分+LCA
- Python Tips
- 分布式和集群
- 80386(win32汇编) proc和 局部变量local的定义
- shell真假01的真相
- 聊聊MTU和MSS(针对以太网)---为什么叙述中用"最大传输单元"的最大值, “最大段”的最大值。
- 最常见的两种防御模型|安全千字文系列2
- 鸟哥Linux学习之——文件操作与管理
- HDU
- mybatis + 首页开发