python入门到精通 pdf-运维必备Python基础入门到精通.pdf

您所在位置:网站首页 > 海量文档

&nbsp>&nbsp计算机&nbsp>&nbspPython

productView-pdf_46x35.gif

运维必备Python基础入门到精通.pdf29页

本文档一共被下载:load.gif次,您可全文免费在线阅读后下载本文档。

donwloaddoc.png

favdoc.png

baiduyixia.png

edit.png

full.png

下载提示

1.本站不保证该用户上传的文档完整性,不预览、不比对内容而直接下载产生的反悔问题本站不予受理。

2.该文档所得收入(下载+内容+预览三)归上传者、原创者。

3.登录后可充值,立即自动返金币,充值渠道很便利

运维必备Python基础入门到精

视频课程汇总

Python函数中文手册

函数列表

1、取绝对值

abs(x)

Returntheabsolutevalue ofanumber.Theargumentmaybeaplainorlong

integerorafloating pointnumber.Ifthe argument isacomplex number,its

magnitudeisreturned.

如果你不知道绝对值什么意思,那就要补一下小学数学了!

基本用法

2

all(iterable)

ReturnTrue ifallelementsofthe iterablearetrue (orifthe iterableisempty).

Equivalentto:

3

any(iterable)

ReturnTrue ifanyelementofthe iterableistrue.Ifthe iterableisempty, return

False.Equivalentto:

4

basestring()

This abstract type is the superclass for str an unicode. It cannot be calle or

instantiate , but it can be use to test whether an object is an instance of str or

unicode.isinstance(obj,basestring)isequivalentto isinstance(obj,(str, unicode)).

是字符串和字符编码的超类 ,是抽象类型。不能被调用或者实例化。可以用来判断实例是否

为字符串或者字符编码。

5、二进制转换

bin(x)

Convertanintegernumberto a binarystring.The resultisavali Python

expression.Ifx isnota Pythonintobject,ithasto definean__index__() metho

that returnsan integer.

转换成二进制表达

方法:

6、布尔类型

bool([x])

Convertavaluetoa Boolean,usingthe standar truthtesting procedure.Ifx is

falseoromitted,this returnsFalse;otherwiseitreturnsTrue.boolisalsoaclass,

which isasubclassof int.Class boolcannot besubclasse further.Itsonly

instancesare Falsean True

布尔类型的转化

用法:

7、二进制数组的转化

bytearray([source[,encoding[,errors]]])

Returna new arrayof bytes.The bytearray typeisa mutablesequenceof integers

inthe range0 <=x <256.It hasmostofthe usualmethodsof mutable

sequences,describe in MutableSequenceTypes,aswell as mostmethodsthat

the strtype has,seeString Methods.

The optionalsource parametercan beuse to initializethe array inafew different

ways:

 If itisastring,you mustalsogivetheencoding (an optionally,

errors) parameters; bytearray()then convertsthe stringto bytes

usingstr.encode().

 If itisaninteger,thearraywill havethat sizean will beinit

发表评论

请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。

用户名:

验证码:

detail-code.png

匿名?

发表评论

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值