0001aboutSTRWord文档下载推荐.docx

上传人:b****6 文档编号:21910291 上传时间:2023-02-01 格式:DOCX 页数:16 大小:28.29KB
下载 相关 举报
0001aboutSTRWord文档下载推荐.docx_第1页
第1页 / 共16页
0001aboutSTRWord文档下载推荐.docx_第2页
第2页 / 共16页
0001aboutSTRWord文档下载推荐.docx_第3页
第3页 / 共16页
0001aboutSTRWord文档下载推荐.docx_第4页
第4页 / 共16页
0001aboutSTRWord文档下载推荐.docx_第5页
第5页 / 共16页
点击查看更多>>
下载资源
资源描述

0001aboutSTRWord文档下载推荐.docx

《0001aboutSTRWord文档下载推荐.docx》由会员分享,可在线阅读,更多相关《0001aboutSTRWord文档下载推荐.docx(16页珍藏版)》请在冰豆网上搜索。

0001aboutSTRWord文档下载推荐.docx

printx.__add__("

hello"

printx.__contains__("

isaTest"

|__eq__(self,value,/)

|Returnself==value.

|__format__(...)

|S.__format__(format_spec)->

str

|ReturnaformattedversionofSasdescribedbyformat_spec.

|__ge__(self,value,/)

|Returnself>

=value.

|__getattribute__(self,name,/)

|Returngetattr(self,name).

|__getitem__(self,key,/)

|Returnself[key].

|__getnewargs__(...)

|__gt__(self,value,/)

value.

|__hash__(self,/)

|Returnhash(self).

|__iter__(self,/)

|Implementiter(self).

|__le__(self,value,/)

|Returnself<

|__len__(self,/)

|Returnlen(self).

|__lt__(self,value,/)

|__mod__(self,value,/)

|Returnself%value.

|__mul__(self,value,/)

|Returnself*value.n

|__ne__(self,value,/)

|Returnself!

|__new__(*args,**kwargs)frombuiltins.type

|Createandreturnanewobject.Seehelp(type)foraccuratesignature.

|__repr__(self,/)

|Returnrepr(self).

|__rmod__(self,value,/)

|Returnvalue%self.

|__rmul__(self,value,/)

|Returnself*value.

|__sizeof__(...)

|S.__sizeof__()->

sizeofSinmemory,inbytes

|__str__(self,/)

|Returnstr(self).

|capitalize(...)

|S.capitalize()->

|ReturnacapitalizedversionofS,i.e.makethefirstcharacter

|haveuppercaseandtherestlowercase.

|casefold(...)

|S.casefold()->

|ReturnaversionofSsuitableforcaselesscomparisons.

|center(...)

|S.center(width[,fillchar])->

|ReturnScenteredinastringoflengthwidth.Paddingis

|doneusingthespecifiedfillcharacter(defaultisaspace)

printx.center(50,'

_'

#************thisisaTestingString!

************

|

|count(...)

|S.count(sub[,start[,end]])->

int

|Returnthenumberofnon-overlappingoccurrencesofsubstringsubin

|stringS[start:

end].Optionalargumentsstartandendare

|interpretedasinslicenotation.

printx.count('

'

|encode(...)

|S.encode(encoding='

utf-8'

errors='

strict'

)->

bytes

|EncodeSusingthecodecregisteredforencoding.Defaultencoding

|is'

.errorsmaybegiventosetadifferenterror

|handlingscheme.Defaultis'

meaningthatencodingerrorsraise

|aUnicodeEncodeError.Otherpossiblevaluesare'

ignore'

'

replace'

and

|'

xmlcharrefreplace'

aswellasanyothernameregisteredwith

|codecs.register_errorthatcanhandleUnicodeEncodeErrors.

|endswith(...)

|S.endswith(suffix[,start[,end]])->

bool

|ReturnTrueifSendswiththespecifiedsuffix,Falseotherwise.

|Withoptionalstart,testSbeginningatthatposition.

|Withoptionalend,stopcomparingSatthatposition.

|suffixcanalsobeatupleofstringstotry.

|expandtabs(...)

|S.expandtabs(tabsize=8)->

|ReturnacopyofSwherealltabcharactersareexpandedusingspaces.

|Iftabsizeisnotgiven,atabsizeof8charactersisassumed.

|find(...)

|S.find(sub[,start[,end]])->

|ReturnthelowestindexinSwheresubstringsubisfound,

|suchthatsubiscontainedwithinS[start:

end].Optional

|argumentsstartandendareinterpretedasinslicenotation.

|Return-1onfailure.

|format(...)

|S.format(*args,**kwargs)->

|ReturnaformattedversionofS,usingsubstitutionsfromargsandkwargs.

|Thesubstitutionsareidentifiedbybraces('

{'

and'

}'

).

|format_map(...)

|S.format_map(mapping)->

|ReturnaformattedversionofS,usingsubstitutionsfrommapping.

|index(...)

|S.index(sub[,start[,end]])->

|LikeS.find()butraiseValueErrorwhenthesubstringisnotfound.

|isalnum(...)

|S.isalnum()->

|ReturnTrueifallcharactersinSarealphanumeric

|andthereisatleastonecharacterinS,Falseotherwise.

|isalpha(...)

|S.isalpha()->

|ReturnTrueifallcharactersinSarealphabetic

|isdecimal(...)

|S.isdecimal()->

|ReturnTrueifthereareonlydecimalcharactersinS,

|Falseotherwise.

|isdigit(...)

|S.isdigit()->

|ReturnTrueifallcharactersinSaredigits

|isidentifier(...)

|S.isidentifier()->

|ReturnTrueifSisavalididentifieraccording

|tothelanguagedefinition.

|Usekeyword.iskeyword()totestforreservedidentifiers

|suchas"

def"

and"

class"

.

importkeyword

printkeyword.iskeyword("

|islower(...)

|S.islower()->

|ReturnTrueifallcasedcharactersinSarelowercaseandthereis

|atleastonecasedcharacterinS,Falseotherwise.

|isnumeric(...)

|S.isnumeric()->

|ReturnTrueifthereareonlynumericcharactersinS,

print"

98673"

.isalnum()

|isprintable(...)

|S.isprintable()->

|ReturnTrueifallcharactersinSareconsidered

|printableinrepr()orSisempty,Falseotherwise.

|isspace(...)

|S.isspace()->

|ReturnTrueifallcharactersinSarewhitespace

|istitle(...)

|S.istitle()->

|ReturnTrueifSisatitlecasedstringandthereisatleastone

|characterinS,i.e.upper-andtitlecasecharactersmayonly

|followuncasedcharactersandlowercasecharactersonlycasedones.

|ReturnFalseotherwise.

|isupper(...)

|S.isupper()->

|ReturnTrueifallcasedcharactersinSareuppercaseandthereis

|join(...)

|S.join(iterable)->

|Returnastringwhichistheconcatenationofthestringsinthe

|iterable.TheseparatorbetweenelementsisS.

|ljust(...)

|S.ljust(width[,fillchar])->

|ReturnSleft-justifiedinaUnicodestringoflengthwidth.Paddingis

|doneusingthespecifiedfillcharacter(defaultisaspace).

|lower(...)

|S.lower()->

|ReturnacopyofthestringSconvertedtolowercase.

|lstrip(...)

|S.lstrip([chars])->

|ReturnacopyofthestringSwithleadingwhitespaceremoved.

|IfcharsisgivenandnotNone,removecharactersincharsinstead.

|partition(...)

|S.partition(sep)->

(head,sep,tail)

|SearchfortheseparatorsepinS,andreturnthepartbeforeit,

|theseparatoritself,andthepartafterit.Iftheseparatorisnot

|found,returnSandtwoemptystrings.

|replace(...)

|S.replace(old,new[,count])->

|ReturnacopyofSwithalloccurrencesofsubstring

|oldreplacedbynew.Iftheoptionalargumentcountis

|given,onlythefirstcountoccurrencesarereplaced.

print"

.replace("

86"

"

_RPLS_"

|rfind(...)

|S.rfind(sub[,start[,end]])->

|ReturnthehighestindexinSwheresubstringsubisfound,

printx

foriinxrange(len(x)):

sys.stdout.write(str(i%10))

print

printx.rfind('

0,17)

|rindex(...)等同于上面的函数

|S.rindex(sub[,start[,end]])->

|LikeS.rfind()butraiseValueErrorwhenthesubstringisnotfound.

|rjust(...)

|S.rjust(width[,fillchar])->

|ReturnSright-justifiedinastringoflengthwidth.Paddingis

|rpartition(...)

|S.rpartition(sep)->

|SearchfortheseparatorsepinS,startingattheendofS,andreturn

|thepartbeforeit,theseparatoritself,andthepartafterit.Ifthe

|separatorisnotfound,returntwoemptystringsandS.

|rsplit(...)

|S.rsplit(sep=None,maxsplit=-1)->

listofstrings

|ReturnalistofthewordsinS,usingsepasthe

|delimiterstring,startingattheendofthestringand

|workingtothefront.Ifmaxsplitisgiven,atmostmaxsplit

|splitsaredone.Ifsepisnotspecified,anywhitespacestring

|isaseparator.

|rstrip(...)

|S.rstrip([chars])->

|ReturnacopyofthestringSwithtrailingwhitespaceremoved.

|split(...)

|S.split(sep=None,maxsplit=-1)->

|delimiterstring.Ifmaxsplitisgiven,atmostmaxsplit

|splitsaredone.IfsepisnotspecifiedorisNone,any

|whitespacestringisaseparatorandemptystringsare

|removedfromtheresult.

|splitlines(...)

|S.splitlines([keepends])->

|ReturnalistofthelinesinS,breakingatlineboundaries.

|Linebreaksarenotincludedintheresultinglistunlesskeepends

|isgivenandtrue.

|startswith(...)

|S.startswith(prefix[,start[,end]])->

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 总结汇报 > 学习总结

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1