码迷,mamicode.com
首页 >  
搜索关键字:python内置函数    ( 473个结果
Python内置函数
map,filter, reduce, zip都是针对python中的sequence数据类型的内置方法。 一、map map(func, *iterables) 先来看看map函数,接收两个参数,第一个是函数,第二个是序列(可迭代对象),map的作用是将序列中的每一个元素传入函数中,并将返回结果加 ...
分类:编程语言   时间:2017-03-30 23:25:43    阅读次数:256
Python-内置函数4
name="one"''' bin() oct() hex() bytes() ascii() any() all() abs() bool() str() dict() list() callable() 判断能不能被调用,多数用于函数 char() 将ascii码对应的数转为字符 ord() 将 ...
分类:编程语言   时间:2017-03-09 20:37:18    阅读次数:220
python-内置函数-
1、#快速查看一个类提供了哪些功能 print(dir(dict))2、#打印类详细的说明 help(list) 3、#除法运算获取商和余数,返回元组 divmod() r=divmod(97,10)结果返回元组:(9,7)第一个元素为商,第二个元素为余数 #把商赋给n1,余数赋给n2 n1,n2= ...
分类:编程语言   时间:2017-02-27 21:28:08    阅读次数:210
python内置函数5-filter()
Helponbuilt-infunctionfilterinmodule__builtin__:filter(...)filter(functionorNone,sequence)->list,tuple,orstringReturnthoseitemsofsequenceforwhichfunction(item)istrue.IffunctionisNone,returntheitemsthataretrue.Ifsequenceisatupleorstring,returnthesametype,..
分类:编程语言   时间:2017-02-22 15:33:43    阅读次数:197
python内置函数5-float()
Helponclassfloatinmodule__builtin__:classfloat(object)|float(x)->floatingpointnumber||Convertastringornumbertoafloatingpointnumber,ifpossible.||Methodsdefinedhere:||__abs__(...)|x.__abs__()<==>abs(x)||__add__(...)|x.__add__(y)<==>x+y||__coerc..
分类:编程语言   时间:2017-02-22 15:32:55    阅读次数:236
python内置函数5-format()
Helponbuilt-infunctionformatinmodule__builtin__:format(...)format(value[,format_spec])->stringReturnsvalue.__format__(format_spec)format_specdefaultsto""format(value[,format_spec])Convertavaluetoa“formatted”representation,ascontrolledbyformat_spec.Thei..
分类:编程语言   时间:2017-02-22 15:29:28    阅读次数:206
python内置函数5-getattr()
Helponbuilt-infunctiongetattrinmodule__builtin__:getattr(...)getattr(object,name[,default])->valueGetanamedattributefromanobject;getattr(x,‘y‘)isequivalenttox.y.Whenadefaultargumentisgiven,itisreturnedwhentheattributedoesn‘texist;withoutit,anexceptionisr..
分类:编程语言   时间:2017-02-22 15:26:56    阅读次数:184
python内置函数4-eval()
Helponbuilt-infunctionevalinmodule__builtin__:eval(...)eval(source[,globals[,locals]])->valueEvaluatethesourceinthecontextofglobalsandlocals.ThesourcemaybeastringrepresentingaPythonexpressionoracodeobjectasreturnedbycompile().Theglobalsmustbeadictionarya..
分类:编程语言   时间:2017-02-21 20:01:21    阅读次数:223
python内置函数4-file()
Helponclassfileinmodule__builtin__:classfile(object)|file(name[,mode[,buffering]])->fileobject||Openafile.Themodecanbe‘r‘,‘w‘or‘a‘forreading(default),|writingorappending.Thefilewillbecreatedifitdoesn‘texist|whenopenedforwritingorappending;itwillbetruncat..
分类:编程语言   时间:2017-02-21 19:57:49    阅读次数:164
python-内置函数
字符串转换成字节 字节转换成字符串 ...
分类:编程语言   时间:2017-02-21 11:39:03    阅读次数:170
473条   上一页 1 ... 31 32 33 34 35 ... 48 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!