Table Of ContentTHIRDE DITION
P R 0R AGM M IG :N
AN INTRODUCTIOTNO COMPUTERS CIENCE
OHN ZELLE
FRANKLIN, BEEDLE
[INDEPENPDUEBNLTI SHSEIRNSC1 E9 85]
PYTHONP ROGRAMMING
AN INTRODUCTION TO COMPUTER SCIENCE
THIRDE DITION
JohMn. Z elle
WartbuCrogl lege
2154 100 9723520 3/284-6348
FranklBieednl,e& AssociatIesn c.+ NE BroadwSayu,i te +PortlanOdr,e gon + + www .fbeedle.com
Publisher TomS umne(rt sumner@fbeedle.com)
Editor BrendJao nes
ProductAisosno ciateJ aroAnyres
CovePrh otography JimL eis©2y0 12
Printientd h eU .S.A.
Nameso fa lplr oduchtesr earien usefdo ird entification pounrplaoyns dea sr etr ademarks
&
and/orre gistered troafdt ehmeairrrek ssp ectoiwvnee rFsr.a nklBiene,d leA ssociates
Incm.a kenso c laiomfo wnershoircp o rporaatses ociawtiitothnh ep roducotrcs o mpa
nietsh aotw nt hem.
©2017 &
FranklBiene,d leA ssociates IncoNrop poarraottf te hdi.bs o okm ayb er epro
duceds,t orienda retriesvyaslt etmr,a nsmitotret dr,a nscriibnae ndy,f ormo rb ya ny
means-electromneicch,a nictaell,e patphhioct,o copyriencgo,r dionrgo ,t herwise
withopurti or written poeftr hmeip susbiloiensr h.R equesftosrp ermisssihoonu lbde
addressaesfd o llows:
Rightasn dPe rmissions
&
FrankliBne,e dleA ssociaItnecso rporated
2154 100
NE BroadwaSy,u ite
97232
PortlaOnrde,g on
LibraorfCy o ngreCsast aloging-in-Pduabtlai cation
NamesZ:e llJeo,h Mn. ,a uth.o r
I
TitlPey:t hopnr ogramm:ia nnig n troducttoic oonm putsecri encJeo hMn.
ZellWea,r tbuCrogl lege.
I
DescripTthiiorned:d i tioPonr.t lanOdr,e go:nF ranklinB,e ed&l e
I
AssociIantce[.s2, 0 16I]n clubdiebsl iograrpehfiecraelan ncdei sn dex.
I
IdentifiLeCrCsN2: 0 1602433I8S BN9 781590282755
SubjecLtCsS:H P:y thon( Computperro grlaamn guage)
I
ClassificLaCtCiQ oAn7:6 .73.ZP99828 0 16 DDC0 05.13/3--dc23
LCr ecoarvda ilaabthl tet p/sl:c/cn .loc.gov/2016024338
Contents
ForewobrydG ,u idvoa nR ossu.m. ...........................................................................i..x.. ...... .
Preface x
.......................................................................................... .......................... .. .......
Chapte1r Computearnsd P rograms 1
1.1 TheU niverMsaaclh ine 1
........................................................................... ................
1.2 PrograPmo wer 3
......................................................................................................
1.3 WhatI sC omputSecri enc..e.?. ...................................3. ..........................................
.
1.4 HardwaBraes i.c.s. .................................................................. ..5.. .........................
. . .
1.5 ProgrammLianngg uag.e.s. ....................................................6. ............................
. . . .
1.6 TheM agiocf P ytho..n. .....................................................9... ..............................
. . . .
1.7 Insiad Pey thoPnr ogr.a.m. .....................................................1..5.. ........................
. .
1.8 Chaoasn dC ompute.r..s.. .....................................................1.8. ..........................
. . . .
1.9 ChaptSe ru m m.a.r.y.. .....................................................2.0. .................................
. . .
1.10 Exerc.i.s.e.s. ......................................2.1. .................................................................
Chapte2r WritinSgi mplPer ograms 27
2.1 TheS oftwareD evelopmPernotc e.s.s. .......................................2..7.. ............. .........
. .
2.2 Examp ieP rograTme :mp eratuCornev er.t.e.r. ...................2.8. ..................................
2.3 ElemenotfPs r ogra.m.s. ................................3.1. ....................................................
2.3.1N ame.s. .....................................3.1. ............................................................
2.3.2E xpress.i.o.n.s. .......................................................................3..2.. ......... .
. . . .
0
2.4 utput Stat.e.m.e.n.t.s. ....................................................................3...4... ........ .
. . . .
2.5 AssignmSetnatt eme.n.t.s. .....................................................3..6.. .........................
. .
2.5. 1 S ip ImAe s signt .m .e.n. ...........................................................3. .7. ............
. . . .
2.5.2A ssignIinnpg.u .t. ......................................................3..9.. .........................
. .
2.5.3S imultaneous A.s.s.i.g.n.m.e.n.t.. ...................................4..1.. ....... ..............
. .
2.6 DefinLiotoep .s. ..................................................4..3.. ....... ...................................
. . .
.
Contents
IV
2.7 ExamplPer ograFmu:t uVrael u.e. ...........................4.7. ............................................
2.8 ChaptSeurm mar.y. ...................................5.0. .........................................................
2.9 Exercises 51
.................................. ............................................................................
Chapte3r Computinwgi thN umbers 57
3.1 NumeriDca taT ype.s. ..................................................5..7.. ....................................
3.2 Type ConversainodnR so undi.n.g. ..........................6.2. ............................................
3.3 Usintgh eM athL ibrary 65
........................................................................................
3.4 AccumulatRiensgu lFtasc:t or.i.a.l.s. ........................6.8. ...........................................
3.5 LimitatoifoC nosm putAerri thme.t.i..c. ......................7.1. ........................................
3.6 ChaptSeurm mar.y. ...................................7.5. .........................................................
3.7 Exerc.i.s.e.s. ......................................7.6. .................................................................
Chapte4r Objectasn dG raphics 83
4.1 Overvi..e.w. .......................................8.3. .................................................................
0 0
4.2 T h eb e jc to f be jc t.s .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
4.3 SimplGer aphiPcrso gramm.i.n.g. ...........................8.5. .............................................
4.4 Using GraOpbhjiecca.tl.s . ...................................................9.1. ...............................
4.5 GraphiFnugt uVrael u.e. .................................9.6. ....................................................
4.6 ChoosiCnogo rdin.a.t.e.s. ..............................1.0.3. ...................................................
4.7 InteracGtriavpeh i..c.s. ................................1.0.7. ....................................................
4.7.1G ettiMnogu sCel ic.k.s. ...........................1.0.7. ............................................
4.7 .2 HandliTnegxt uaIln pu.t.. ..........................1.0.9. ..........................................
4.8 GraphiMcosd ulRee fere.n.c.e. ...........................1.1.2. ..............................................
4.8.1G rapWhi nO bjec.t.s. .............................1.1.3. ..............................................
0
4.8 .2 Gr ap hic s be jc t.s .. . . . . . . . . . . . . . . . . .1 1.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.8.3E ntrOyb jec.t.s. ...............................1.1.9. ...................................................
4.8.4D isplayImi angge .s. ..............................1.2.0. ...............................................
4.8.5G eneratCionlgo .r.s. .............................1.2.1. ...............................................
4.8.6C ontrollingU pDdiastp(elAsad yv anc.e.d.). ...............1.2.1. ..........................
4.9 ChaptSeurm m ar.y . . . . . . . . . . . . . . . . . . . . 1.2 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.10 Exerc.i.s.e.s. .....................................1.2.3. ...............................................................
Chapte5r SequenceSst:r ingLsi,s tasn,d F iles 129
5.1 TheS triDnagt aTy pe. .................................1.2.9. ...................................................
5.2 Sim pieSt riPnrgo ces.s.i.n.g. ............................1.3.3. ................................................
5.3 LisatssS equen.c.e.s. .................................1.3.6. ......................................................
5.4 StriRnegp resentaantdiM oens sagEen codi.n.g. ..................1.3.9. .............................
5.4.1S triRnegp resent.a.t.i..o.n. .......................1.3.9. ............................................
5.4.2P rogrammainnE gn cod.e.r. .........................1.4.1. .......................................
5.5 StriMnegt ho.d.s. ...................................1.4.2. .........................................................
5.5.1P rogrammai Dnegc od.e.r. .........................1.4.2. .........................................
5.5.2M oreS triMnegt ho.d.s. ...........................1.4.6. ............................................
5.6 LisHtasv eM ethodTso.o. ................................1.4.7. ...............................................
5.7 FromE ncoditnogE ncryp.t.i.o.n. .........................1.5.0. ............................................
Contents
v
5.8 Input/OuatspS uttr iMnagn ipulation 151
.................................................................
5.8 .1 Examp iAep plicatDiaotneC: o nversion 151
...................................................
5.8 .2 StriFnogr matt.i.n.g. ...............................................................1..5..4.. ......
. . .
5.8.3B ettCehra ngCeo unt.e.r. ..........................1.5.7. .........................................
.
5.9 File Pro.c.e.s.s.i.n.g. ..............................................................1..5..8.. .....................
. .
5.9.1M ulti-Sltirnie.n .g.s. .............................1.5.8. ...............................................
5.9.2F ilPer oces.s.i.n.g. .............................1.5.9. ..................................................
5.9.3E xample ProBgartacmUh:s erna.m.e.s. .................1.6.3. ..............................
5.9.4F ilDei alo(gOsp tion..a.l.). ........................1.6.4. ..........................................
5.10 ChaptSeurm mar.y. ...................................1.6.7. ......................................................
5.11 Exercises 168
............................................................................................................
Chapte6r DefiniFnugn ctions 175
6.1 TheF unctioofFn u ncti.o.n.s. ............................1.7.5. ..............................................
6.2 FunctioInnsf,o rm.a.l.l.y. ..............................1.7.7. ....................................................
6.3 FutuVrael uwei tah F unct.i.o.n. ..........................1.8.1. ............................................
6.4 FunctiaonndsP armae terTsh:e E xcitDientgiIa s. ...................................1..8..3.. ... .
. . .
6.5 FunctiTohnastR eturVna lu.e.s. ..........................................................1...8...7.. ....
. . .
6.6 FunctitohnasMt o dify Pmaertae .r.s. .......................................1..9..3.. ............. .......
. .
6.7 FunctiaonndsP rograSmt ruct.u.r.e. .........................................1..9..9.. .. ................
. .
6.8 ChaptSeurm mar.y. ...................................2.0.2. ......................................................
6.9 Exerc.i.s.e.s. .....................................2.0.3. ...............................................................
Chapte7r Decision Structures 209
7.1 Simp ieD ecisi.o.n.s. .................................................2..0..9.. .....................................
7.1.1E xamplTee:m peratWuarren in.g.s. .....................2.1.0. .................................
7.1.2F ormiSnigm plCeo nditi.o.n..s. ......................2.1.2. ......................................
7. 1.3E xamplCeo:n ditaIi P orno graEmx ecut.i.o.n. ...............2.1.4. .........................
7.2 Two-Way Decisi.o.n..s. ...............................2.1.6. .....................................................
7.3 Multi-WDaeyc isi.o.n.s. ...........................................2..2..0.. .............................. .......
7.4 ExceptHiaonnd l.i.n.g. ................................2.2.3. .....................................................
7.5 Studiyn D esigMna:x o fT hre.e. .............................................2..2..7.. ............ ........
. .
7.5.1S trate1g:C yo mparEea cht oA l.l.... ..............................2...2...8. ...............
. . .
7.52. Strate2g:D ye cisTiroen.e . ...........................................2..3..0.. .. ................
. .
7. 5.3S trate3g:S ye quentPiraolc es.s.i.n.g. ..................2.3.1. .................................
7. 5.4S trate4g:U ys eP yth.o.n. ..........................2.3.4. ..........................................
7. 5.5S omeL esso.n.s. ...............................2.3.4. ...................................................
7.6 ChaptSeurm mar.y. ...................................2.3.5. ......................................................
7.7 Exerc.i.s.e.s. .....................................2.3.6. ...............................................................
Chapte8r LoopS tructuarnedsB ooleans 243
8.1 ForL oopAs :Q uicRke vi.e.w. ............................2.4.3. ..............................................
8.2 IndefiLnoiotpe.s. ....................................2.4.5. ........................................................
8.3 CommonL oopP atte.r.n.s. .............................2.4.7 . .................................................
8.3 .1 InteracLtoiovp.es. ................................................................7.. ........... .24
. . .
8.3.2S entiLnoeolp .s. ....................................................................2.4.9. ..........
. . . .
Contents
vi
8.3.3F ilLeo ops 252
......................................................................... .....................
8.3.4N esteLdo ops 254
...................................................... ...................................
8.4 Computiwnigt Bho ol ean..s. .............................2.5.6. ...............................................
8.4.1B ooleOapne arto.r.s. .............................2.5.6. ..............................................
8.4.2B ooleAalng eb.r.a. ..............................2.6.0. ................................................
8.5 OtheCro mmonS tructures 262
............................ ........ .............................................
8.5.1P ost-tLeosot.p . ................................2.6.2. ..................................................
8.5.2L oopa nda Hal.f. ...............................2.6.4. ................................................
8.5.3B ooleEaxnp ressaisoD nesc isi.o.n.s. ...................2.6.6. .................................
8.6 ExamplAe S:i mple ELvoeon.pt. ...........................2.6.9. ..........................................
8.7 ChaptSeurm mar.y. ...................................2.7.5. ......................................................
8.8 Exercises 277
............................................................................................................
Chapte9r SimulatainodnD esign 283
9. 1 S i amti un R Iagc que tb aI .I .. . . . . . . . . . . . . . . . . . .8 .3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
9.1.1A SimulatPiroonb lem 284
............................................................................
9. 12. Anal ysainsd S pecific.a.t..i.o.n. .....................2.8.4. .......................................
9.2 Pseudo-ranNduommb er..s. ..............................2.8.6. ...............................................
9.3 Top-DowDne si.g.n. ..................................2.8.8. ......................................................
9.3 .1 TopL-eveDle sign 289
....................................... ............................................
9.3 .2 SeparatoifCo onn cerns 291
..................................... .....................................
9.3.3S econd-LDeevseilg n 291
..............................................................................
9.3.4D esignsiinmgN Games 293
............................................................................
9.3.5T hird-LDeevseilg n 295
.................................................................................
9.3.6F inishUipn g 298
..........................................................................................
9.37. Summaroyf t heD esigPnr ocess 300
.............................................................
9.4 BottoUmp- Implement.a.t.i.o.n. .........................3.0.1. ..............................................
9.4.1U niTte sti.n.g. ................................3.0.1. ....................................................
9.4.2S imulatRieosnu l..t.s. ............................3.0.3. ..............................................
9.5 OtheDre sigTne chniques 304
...................................................................................
9.5.1P rototyapnidnS gp irDaelv elopment 304
......................................................
9.5.2T heA rt ofD esign 306
............................................................ ......................
9.6 ChaptSeurm mary 306
..............................................................................................
9.7 Exercises 307
............................................................................................................
Chapte1r0 DefiniCnlga sses 313
10.1 QuicRke vieowfO bjects 313
...................... ..............................................................
10.2 ExamplPer ograCma:n nonball 314
.............................. .............................................
10.2.P1 rograSmp ecification 314
............................................................................
10.2.D2 esigntihnePg r ogr.a.m. ..........................3.1.5. ..........................................
10.2.M3 odu lariztihnePg r ogra..m. ........................3.1.9. .......................................
10.3 DefiniNnegwC lass.e..s. ...............................3.2.1. ...................................................
10.3.E1 xamplMeu:l ti-sDiidce.ed. .........................3.2.1. .......................................
10.3.E2 xamplTeh:e P rojectile Class 325
................................................................
10.4 DataP rocesswiintgCh l ass 327
............................................. ...................................
0
10.5 bjecatnsd E ncapsulation 331
.................................................................................
..
Contents
VII
10.5.1E ncapsulaUtsienfAgub lst ract.i.o.n.s. ..................3.3.1. ................................
10.5.P2 uttiCnlga ssienMs o dul.e.s. ........................3.3.3. ......................................
10.5.M3 odulDeo cmuentation 333
.........................................................................
10.5.W4o rkinwgi tMhu ltiMpoldeu les 335
.............................................................
10.6 Widgets 337
.............................................................................................................
10.6.E1 xamplPer ograDmi:c Reo ll.e.r. ............................................................ 337
10.6.B2 uildBiuntgt o.n.s. ..............................3.3.8. ................................................
10.6.B3 uildDiincg.e . .................................3.4.2. ...................................................
10.6.T4h eM ainP rogr.a.m. ............................3.4.5. ..............................................
107. Animtae dC ann onb aI .I . . . . . . . . . . . . . . . . . . . 3.4 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.7.D1 rawitnhge A nimatiWoinn do.w. ........................................................... 347
10..72 Creatian Sgh oTtr ack.e.r. ....................................................................... 348
10.7.C3r eatiannIg n puDti al.o.g. .........................3.5.0. .........................................
10.7.T4h eM ainE venLto o.p. ............................3.5.3. ...........................................
108. ChaptSe ru m m.a .r y. . . . . . . . . . . . . . . . . . . 3.5 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.9 Exerc.i.s.e.s. .....................................3.5.6. ...............................................................
Chapte1r1 DataC ollections 363
11.1 Exma pieP robl:e mSp iieS m t atis.t..i.c.s. .....................3.6.3. ......................................
11.2 Applying ..L.i.s.t.s. ................................3.6.5. ..........................................................
11.2.L1 isatnsd A rra.y.s. ..............................3.6.6. .................................................
0
11.22 .L istp erati.o.n.s.. .............................3.6.7. .................................................
11.2.S3t atiswtiitcLhsi s.t.s. ............................3.7.0. ..............................................
11.3 LisotfsR ecor.d.s. ...................................3.7.5. ........................................................
11.4 Designwiintgh LainsdCt ls ass.e.s. .........................3.7.9. .........................................
11.5 CaseS tudyP:y thoCnal eIuta o .r. ........................................3..8..5.. ...........................
11.5.A1 Calculaasta onrO bje.c.t. .........................3.8.5. .......................................
11.5.C 2o nstructthieIn ngt er.f.a.c.e. .......................3.8.5. .......................................
11.5.P3 rocessBiuntgt o.n.s. ............................3.8.8. ..............................................
11.6 Case Study: BetbtaIe AIrn iCmaant .in.oo.nn. ...................................................... 392
11..61 Creatian Lga unc.h.e.r. ...........................3.9.3. .............................................
11.6.T2r ackiMnugl tiSphloet .s. ...........................3.9.6. .........................................
11.7 Non-sueeqn at iCI o llecti.o.n..s. ...........................4.0.1. ...............................................
11..71 DictionBaarsyi. c.s. ..............................4.0.1. ...............................................
0
11.27 .D ictionapreyr ati.o.n.s. ..........................4.0.2. ...........................................
11.7.E3 xamplPer ograWmo:r dF reque.n.c.y. ..................4.0.4. ..............................
118. ChaptSe ru m m.a .r y. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
11.9 Exerc.i.s.e.s. .....................................4.1.0. ...............................................................
Chapte1r2 ObjecOtr-ientDeeds ign 419
12.1 TheP roceosfsO OD. ..................................4.1.9. ....................................................
12.2 CasSet udyR:a cuqe tbIaIS imulat.i.o.n.. .....................4.2.2. ......................................
12.2.C1a ndidOabtjee catnsd M ethod..s. .....................4.2.2. .................................
12.2.I2 mplementing .S.i.m.S.t.a.t.s. ....................4.2.4. ..........................................
12.2.I3 mplemenRtBianigi Ga.m.e. .........................4.2.6. ........................................
12.2.I4 mplemenPtlianyg.e .r. ...........................................4..2..9.. ..........................
Contents
v111
12.2.T5h eC omplePtreo gr.a.m. ..........................4.3.0. ..........................................
12.3 CasSet udyD:i cPeo ke.r. ................................4.3.3. .................................................
12.3.P1 rograSmp ecification 433
............................................................................
12.3.I2 dentifyCianngd idOabtjee cts 434
................................................................
12.3.I3 mplementthienM go del 436
........................................................................
12.3.A4 TextB-aseUd .I. ...............................4.4.0. ................................................
12.3.D5 evelopai nGg. U. .I. .............................4.4.3. ...............................................
00
12.4 Concep.t.s. ....................................4.5.1. ...........................................................
12.4.1E ncapsul.a.t.i.o.n. ............................4.5.2. ...................................................
12.4.P2 olymoirsp.mh. ................................4.5.3. ...................................................
12.4.3I nheri.t.a.n.c.e. ....................................................4..5..3. ..............................
125. ChaptSe ru m m.a .r y. . . . . . . . . . . . . . . . . . . 4.5 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12.6 Exercises 456
............................................................................................................
Chapte1r3 Algorithm DaensdiR genc ursion 459
13.1 Search.i.n.g. ......................................4.6.0. ..............................................................
13.1.A1 Sim pieSe archPirnogb l.e.m. .......................4.6.0. .....................................
13.1.S2t rate1g:L yi neSaera r.c.h. .........................4.6.1. ........................................
13.1.S3t rate2g:B yi nary S.e.a.r.c.h. ......................4.6.2. .......................................
13.1.C4 omp ariAnlgg orit.h.m.s. .........................4.6.3. ...........................................
13.2 RecursPirvoeb lSeoml vi.n.g. .............................4.6.5. ..............................................
13.2.R1 ecursDievfei ni.t.i.o.n.s. .........................4.6.6. ............................................
13.2.R2 ecursFiuvnec ti.o.n.s. ...........................4.6.8. .............................................
13.2.E3 xamplSet:r iRnegv er.s.a.l. ........................4.6.9. ........................................
13.2.E4 xamplAen:a gra.m.s. ............................4.7.1. .............................................
13.2.E5 xamplFea:s Etx ponenti.a.t.i.o.n. ...................4.7.2. ....................................
13.2.E6 xamplBei:n ary S.e.a.r.c.h. .......................4.7.3. .........................................
13.72 .R ecursvisoI.n t era.t.i.o.n. .........................4. 7. .4. .........................................
13.3 SortiAnlgg orit.h.m.s. ................................4.7 .7. ......................................................
13.3.N1 aivSeo rtinSge:l ectSioor.nt. ........................4.7.7. .....................................
13.3.D2 iviadned C onqueMre:r gSeo rt. .......................4.7.9. .................................
13 . 3C o.m p3 ar iS no rtg.s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
13.4 HardP roble.m.s.. ...................................4.8.4. .........................................................
13.4.T1o weorf H ano.i. ................................4.8.4. .................................................
13.4.T2h eH altiPnrgo bl.e.m. ...........................4.8.9. ............................................
13.4.C3 onclu.s.i.o.n. ...............................4.9.2. ......................................................
13.5 ChaptSeurm mar.y. ...................................4.9.3. ......................................................
13.6 Exerc.i.s.e.s. .....................................4.9.4. ...............................................................
AppendiAx P ythoQnu icRke ference 503
AppendiCx G lossary 513
Index 525
Foreword
Whent hep ublisfihressrte nmte a d raoftf t hibso okIw, a si mmediateexlcyi ted.
Disguiassea Py dt hont extboiotik sr, e alalniy n troducttoti hoefin n ea rotf p ro
gramminugs,i nPygt honm erelayst hep refermreeddi ufmo bre ginnTehrisis.s
howI h avael wayism aginPytehdo n woulbde m ostu sefuiln e ducatinoonta: s
theo nllya nguabgueta, s a fi rslta nguajguesa,ts i na rotn em ighstt alreta rning
tod rawu sinagp encrialt htehra tnr yitnogp ainitno irli gahwta y.
Thea uthomre ntioinnhs i psr efatcheaP ty thoinsn ear-iadsea a filr sptr o
grammilnagn guawgiet,h obueti nag" tolya ngua"gAs e t.hec reatoofPr y thoIn
don'wta ntt ot akfuel lc redfiottr h iPsy:t howna sd erivfreodm AB C, laa nguage
designteotd e acphr ogrammiinnt gh ee arl1y9 08sb yL ambeMrete rteLneso,
Geurtasn,do theartsC WI( NatioRneasle arIcnhs titfuotrMe a themataincds
ComputSecri encienA) m sterdaImfIa. d deadn ythitnotg h ewiorr ki,tw asm ak
ingP ythoinn tao n on-tloayn guawgiet,ah b roauds ebra saen da ne xtensive
collecotfis otna ndaarnddt hird-paaprptlyi camtoidounl es.
Ih avneo f ormtaela cheixnpge riesnocI me a,y n otb eq ualifiteojd u dgiet s
educatieoffneaclt iveSnteislasls.a, p rogrammweirt nhe ar3l0y y earesx peri
encer,e aditnhgr outghhec hapteIar ms c ontinuodueslliyg hbtyet dh eb ook's
cleeaxrp lanatoifdo infsfi ccuolntc epIta sl.sl oi kteh em anyg oode xcercainsde s
questiwohnisc bho tthe sutn derstanadniden ngc ourtahgien kaibnogu dte eper
•
ISSUeS.
Readeorft hibso okc,o ngratulaYtoiuwo inlbsle!w elrle wardfeodsr t udying
PythoInp .r omiysoeu 'll fuhna avleo ntgh ew ay,a ndI h opey ouw on'fto rget
youfirr slta nguaognec yeo uh avbee comaep roficiseonftwta red evelo.p er
-Guido Rossum
van
.
IX