![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
雷恩加尔先生
这个作者很懒,什么都没留下…
展开
-
math模块数学常量和函数
1) math.pi # 数学常量π 2) math.e # 数学常量e 3) math.inf # 浮点数的正无穷大,-math.inf 表示负无穷大 4) math.ceil(2.3) # math.ceil(x) 返回不小于x的最小整数 5) math.fabs(-5) # math.fabs(x) 返回x的绝对值 6) math.factorial(5) ...原创 2018-09-11 21:26:04 · 1359 阅读 · 0 评论 -
python常用转义字符
转义字符 说明 \\ 反斜线 \' 单引号 \" 双引号 \a 响铃符 \b 退格符 \f 换页符 \n 换行符 \r 回车符 \t 水平制表符 \v 垂直制表符 \0 Null, 空字符串 \ooo 八进制表示的ASCII码对应字符 \xhh 十六进制表示的AS...原创 2018-09-12 21:08:34 · 263 阅读 · 0 评论 -
Python格式控制符
格式控制符 说明 s 参数为字符串或其他任何对象 r 同s,但字符串用repr表达式 c 参数为单个字符或字符的ASCII码 d 参数转换为十进制整数 i 参数转换为十进制整数 u 参数转换为十进制整数 o 参数转换为八进制整数 x 参数转换为十六进制整数,字母小写 X 参数转换为十六进制整数,字母大写...原创 2018-09-12 21:28:49 · 2869 阅读 · 0 评论 -
字符串常用方法
1. find find方法可以在一个较长的字符串中查找子字符串。它返回子串所在位置的最左端索引。如果没找到则返回-1 >>> 'With a moo-moo here, and a moo-moo there'.find('moo') 7 >>> subject = '$$$ Get rich now!!! $$$' >>> sub...原创 2019-03-02 10:10:38 · 141 阅读 · 0 评论