Swapcase () ua dab tsi hauv Python?
Swapcase () ua dab tsi hauv Python?

Video: Swapcase () ua dab tsi hauv Python?

Video: Swapcase () ua dab tsi hauv Python?
Video: Tuag ua Dab los yuav cab kom tau 11/14/2018 2024, Tej zaum
Anonim

Python hlua | swapcase ()

Txoj hlua swapcase () method converts alluppercase character to lowercase thiab vice versa of the givenstring, and returns it. Ntawm no yog string_name yog txoj hlua uas nws yuav tsum tau swapped.

Tsis tas li ntawd, dab tsi yog qhov peev txheej () rau hauv python?

Hauv Python , cov peev () method converts thawj tus cim ntawm ib txoj hlua rau peev ( ntawv loj ) tsab ntawv. Yog tias txoj hlua muaj nws thawj tus cim ascapital, ces nws rov qab cov hlua qub. Syntax: string_name. peev () string_name: Nws yog lub npe ntawm txoj hlua uas nws thawj tus cim peb xav tau peev.

Tom qab ntawd, lo lus nug yog, yuav ua li cas koj hloov cov ntaub ntawv hauv python? Hauv Python , qis dua () yog ib txoj hauv kev siv rau kev tuav. Txoj kev qis () rov qab cov hlua qis los ntawm txoj hlua muab. Nws converts tag nrho uppercase cim tolowercase. Yog tias tsis muaj cov cim loj, nws rov qab txoj hlua qub.

.title ua dab tsi hauv Python?

Title ua haujlwm hauv python yog cov Python String Method uas yog siv los hloov cov cim thawj hauv txhua lo lus mus rau Uppercase thiab cov cim ntxiv mus rau Lowercase hauv txoj hlua thiab rov qab txoj hlua tshiab.

Koj siv Isalpha hauv Python li cas?

Cov isalpha () cov txheej txheem rov qab "Teeb" yog tias tag nrho cov cim hauv txoj hlua yog cov tsiaj ntawv, Txwv tsis pub, Itreturns "False". Syntax: hlua. isalpha () Parameters: isalpha () tsis siv tej yam tsis rov qab: 1. True- Yog hais tias tag nrho cov cim nyob rau hauv txoj hlua yog cov tsiaj ntawv. 2. False- Yog txoj hlua muaj 1 lossis ntau dua cov ntawv uas tsis yog tsiaj ntawv.

Pom zoo: