Strings in Python - String Manipulation
Strings in Python - String Manipulation
INDEX
~ Strings
~ Indexing
~Traversing a string
~ String operators
~ String Slices
~ String functions and methods
Sunge
siqunc characins
Wald chasacuns ncles1d uilhin quelisen l
SPmgsslbu unicodechanaclions
lacamplo "abes,, 6ER","22?2sp
Cach chartactn caw b ndiuidudlyaccissid
elASSMAte
Date
Page
Amda
Snduawg
Feeusano inducing Ond Backwand nduru0
FePndmduinaslonks yuem 0 Dnd badkuwasd
Jndiaing
NOTE=he elemunlk a ing cannet kr changid
05 ungsy a Jmmulable.
Eocample-Mame="Python
s
I 9 45 T Eouand undisum
Mare aLP YTHON
6-5 14 3 KBackuwand undiciub
Wato hew each elkmunt Bmame an bu ascusId2
ameLo]=P-Mamt6]
wams Lr3 4llWsult Mn toz eHon as 3ungs
an ummuiabloand canma loechangd
w
N
n 0
t n d sud te indthe lungh 4a sbue
Junlaama)>6as
Cocample.wbpcl =cenpuln
ueulaHhe slatinmu hund the ngth e suuct
9Wuaoralte the heusand sindumung andbockunod
Jindscing tSubyuct2
ale how each elarment kuettan b dusplayed
|waung beth kpunudung badkuandti unduaing
0 3 3 45 67L K K
sulyudt-CoM P |U |TE R 6k
-8-7 -6 -5
-4 -3 E
namuLo'C -some-81
CIASSMALE
Date
Page
wnamt.-0-Nanel-7
ameL]-M-Nama.l6
name.L31e-Name (-51 wwww.e
nameLeJUnamul-4]
nanL 5]T name-31w
maime6 JE -hamtC21 A
Onama L7 Rham L Aa
clAsSMAte
Date
Page
122020P
uro ariplniiera
Chaxacins desd lhun 8ingh.uets deube quetis
Thuy aeammudable
Aungsane aceusstd Sing Maocl
-9ndkars a ueg ndnges kem0 dolusgth-i
ineuaud diecdien and1,9. ungth an
backisngd deuclien On o
aBAga5ning
taatenhteuglah elenulsei astug,on
ohasaduy_at a tume
hame-pylhen
pintit-end=) EC
EC
egramte wad a skung and dlusplay t un
uxeno PdionlEuedlag onechasactie j une
a-unpul(Enleva ung:"
unt Th shunga,n suasL deuia :
Jangth lenka) 0 e.
lb un Hangg Cungth)-/)xa
ntya ringPYTHON
Th snq PYTHONnHOMbs ols
N
clasSMAate
Dafe
Page
haeanali
tEasicSefpyalerns 6Fug
tond
+>(olenalien
nOConcalpnadlen Ehetalipn
MALA
oCHLalis0 w 3tuggbyoinig uweep0
obiungy
Ra pet>kopet u S
umasyod
eaomplen 3*g gegogel
Coamplew L
"abc"* 3 obcabcabc
MaNOp AN
clASSMAte
Date
Page
3">nMalhd
6:ba0Membeshyp epusales atsKu
AM and Metun
ap huma Folse o No
Aa n apon>u
Sub =HELP
Pue
Fals
auo Mgt in ung Fals1
ub Met 6ing>1ue
LetnpansleN pnalers ww
Ryhen'slatienal elpHaleAppluTe uegas
well
a=abo>19aeKaaA adaL
AI=a'sTuuededba
"ABC bcFahe
tPenARSuede (ASGID Malue te chuck >k z=,
N
annole.h2o
o g 48-57
'AZ 65-90 b
a- 97-199
CIASSMAAt
Date
Page
'akA>False
QABCS A8> Tue
3 abed'>
ab9Tue
65 www
Achnl-dakus the rdunal ualua.n Aignmo
Muou he cha1alin eerespendung ta hat
Cdinalualu
opntoc:chn Sint>) 2
&somydle-
deul65)
oin 2all
Pat a dung Aelaunung eim Covimgue
chanoclius em h Pung
| lguoat a
ubdkunge Ma olhirng
penld
9t u ilauw thawacknalingailieen ndicvs
hant awd3e= em 01nelRug
aampe
wgd 'amanng
S d L1 ,5 u ulusn mari
elassmate
Date
Page
Eocaxmple
0 3 4 5 6
7 6 -5 4 -9
ed ='annazing
-word.Co:T dk bKonnN AL
mazung
ana
wwend Ca:5]
azi
Ded 7;-31 NE aho
ama
wnd -5:-1
azun
Vaeualierealuin
iagnanno.Llat11
-urll suhrun chaHacinsalung bzhtecn indius slat
upter he Jongila hvbung
QMna+ing
FQumatjuo00
wed + MoeHd-7:
amarrng
'amagg
Siywac-
unanama Llar dlepislip DEDL
epU epienol
Takus euary t elemint kemtho oubslp genunoi
by ladt :3lep n tho ualhu oh vlp)
Caromple:-
w e d =amazing
U hugnelheds Aat
lwg eati.nireaL
Capilola0
Racun Cerpy hodbungs 4idh M nst
choradlin copoilaliegd.
clAsSMAte
Date
Page
Aoung>.tapulalige)
hale. cajalalige D
Hlle
ub Funga
sedlsub)
sund Caub,15,99)
>S. ind Loub,15,
25)
19
indcoc.
onwasTe nd but raisEe Valuabve the
ubsbung iMat 4ud R0
obiacadabro' mduoc ob, 6) ASC C
okandabra'.mder (lob),4,8)1nhkd
CIASSIMALe
Date
Page
sbElobol93)
DS> 3hl.bakmum) aL2
Eake
950plha O
Riiuwm we oll chanadlus in he alhung
One alphabilss Folaa dlhuua
Kosg isalpha ()
a l = pbcl93
>>sb=Uhelle
»Lsolpha )
Fake
s t . i8alpha)
»sh3. i3salpha)
96digat h
Raunns Tu a l l chanailens h ug a
dugless Foke 6thuurise
Kstwg.usdugt(O O.asG.u EAa
31=abel93'
n = 12345 alesn
clasSMAte
Date
Page
Fase
s2.isdugt cy
>sh3. isdugit ()
Falke
95leunO
Riiuama u all chanalS/ h o dbung ae
euecasR3 Falsu ehitunse
Kleung>islesen)
>>s1=hlle
>>sth=THREE
5tn 3 Gela
soleuRe)
Fola
s13.leustnO
Fak OEK i d
ssace O
Ratuw Tua hre Pn ukuespaca characlirs
n ho aung3kak emutuse.heoAN
oung 2 JDSpaco
un =
ugluAofpace()
sug. isspaca) NAGEald
Seung.isuppinl)
Sringl="HÉLLO" 32Pa14
aung="hot n
sng 3-Abe
Aing 4="U193S
sg.isuipl NDbal
Fose
Aing3i6upjait)
leue
erwusls deung te 03wng i.cenlauung enly
Meusecas2
K3ung2 Jeuser )
sungl="HELLO Uh o
sung =h
sug 3="Abc" Awwwww
Aung4"Ul93"
ungl. JeserOi
e
hng 9.Jeuwen)
hne
sing 3. Jeuses) LL K
ul23
upatnO
upocas Aottons
vlwiwgtea bung onaung Bly
alassmate
Date
Page
Seung.uppusl)
2sing l='HELLO LLL Gsdnl
ung 3 "Abc
nng4 "U193" wRlbONnh
'HELLO
eung 2.uppta) L
THEREw
sbung 3.upue
ABC
»Sung4.uppunO
alarisuith0,endsueth.)D ariad
vSlarlsuital)-uduris Ta the Aung
soth
Eaamoles-
>abeddaskusthccd)
abcd shasiouoith.l"'ob62)
Tue
»'abcd"endsucith Ch)
obd endsuiml'cd."2
istte
Re Tun h e uq e
ehuanse cased, Fals2
Cemput stunce".ule)
Fol
'Appla 9 Rud"ishulO
1me
Dafe
Page
ploce
Ruhuswsa.euma udth oll ocwruwes ooudbslug
elol aupolocud oy Muw wg
8umg.suplocelold, veu
9ugk hon uyeu.ujhaceCak,n)L
9canL you
yeu ond 9 M8eo yeuyeu,O1D
E # onlTRIAL)
TEH#R ###LHEEAHHHL
9 ake alenaton a a usto uplo ch seug
hn he guun olinglchanacdin Js yointd t h eodh
Embr ho uat yple
jewa("biol"hele"))
bial $3hlle
join(("Tual",hlle", "Mew"))
lit)
puta a ugbasid gum vobung 0 thanadte
and Ailuuwsa st Corlainingpltseungs Q8
and
wwwwbus
SSung 6pht &sunglthan>
T M Pyhen. alit )
C,Loe'Pythem'
' L e e Ppthon' splt (o")
CIL, 've Pytk, h'
classmate
Date
Page
lastulienO
phsdhaslbu9 ot the 0Cuha
otpunale and ouum/ @ uol coriainung
-atbteru ho atptnaleaa
Aypalo DLdlaaAL9
- Paut olon o vátpLHalor RLA
a t = " 9exyeyserkugg i Pgiher
d.pailulhen (werokun
Cgeyoyuekigg n Python
vwww