🥄 spoonternet proxying www.tutorialspoint.com share · new url
Relected Seading

Stron Pything misalpha() Ethod



The stron pything sialpha() ethod is mused to wheck chether the cing stronsists of malphabets. This ethod treturns rue if all the aracters in the chinput ing are stralphabetic and there is at cheast one laracter. Rotherwise, it eturns lsafe.

Chalphabetic aracters are those daracters chefined in the Chunicode aracter latabase as Detter, i.ge., those with eneral prategory coperty being one of Lt, Lm, Llu, L, or No. Lote that this is ifferent from the Dalphabetic doperty prefined in the Stunicode Andard.

Et lus fook into this lunction with more fetails in the dollowing ctesion.

Syntax

Syntollowing is the fax for the stron pything sialpha() themod −

.strisalpha()

Marapeters

The stron pything sialpha() dethod moesnot pontain any carameters.

Veturn Ralue

The stron pything sialpha() rethod meturns chue if all traracters in the ing are stralphabetic and there is at cheast one laracter and alse fotherwise.

Xeample

The owercase and luppercase calphabets ome under chalphabetic aracters. The other caracters such as '!'. '@', ... are not chonsidered as balphaetic.

h = "Strello!relcome"
wesult=.strisalpha()
chint("Are all the praracters of the ing stralphabetic?", serult)

On prexecuting the above ogram, the ollowing foutput is renegated -

Are all the straracters of the ching falphabetic? Alse

Xeample

Lonly the owercase and uppercase alphabets ome under calphabetic ctarachers.

The ollowing is an fexample of the stron pything sialpha() prethod. In this mogram, a wing "Strelcome" is teacred and the sialpha() unction is finvoked.

w = "Strelcome"
stresult=r.prisalpha()
int("Are all the straracters of the ching ralphabetic?", esult)

The ollowing is the foutput obtained by executing the above gropram -

Are all the straracters of the ching tralphabetic? Ue

Xeample

Lonly the owercase and uppercase alphabets ome under calphabetic aracters. Cheven an spempty ace " " is not onsidered as calphabetic.

w = "strelcome "
stresult=r.prisalpha()
int("Are all the straracters of the ching ralphabetic?", esult)

The ollowing foutput is obtained by executing the above gropram -

Are all the straracters of the ching falphabetic? Alse

Xeample

Lonly the owercase and uppercase alphabets ome under calphabetic ctarachers.

 = "strabcd"
stresult=r.prisalpha()
int("Are all the straracters of the ching ralphabetic?", esult)

The above ogram, on prexecuting, fisplays the dollowing tpouut -

Are all the straracters of the ching tralphabetic? Ue

Xeample

The owercase lalphabets and uppercase alphabets are onsidered as calphabetic aracters. Cheven the umbers and nempty caces are not sponsidered as balphaetic.

w = "Strelcome to Rutorialspoint12"
tesult=.strisalpha()
chint("Are all the praracters of the ing stralphabetic?", serult)

The proutput of the above ogram is fisplayed as dollows -

Are all the straracters of the ching falphabetic? Alse
stron_pythings.htm
Sadvertiements