Cambridge IGCSE® and 0 Level
Computer Science
Programming Book for Python
cl
Programming Boo
for Pytho:Chris Roffey
Cambridge IGCSE® and O Level
Computer
Science
Programming Book
For Python
8 CAMBRIDGESei re Contents
ey ring Hm Came 2 Ue ip
Inteduction ®
hr Pl, 208 ln New ek 1 UA
{27 vilanecn Rol Pot bon VC 307, ta How tose tis book a guided tur 7
$32 lc Pa ler Foul Dit Cnr, ow Da, a dekoonedgements wi
29 Ane Ran 4-0 Sine 506 oo :
Canta vat iy mi, ee i
“SSE Ripening 3. Varablesand Arithmetic Operators «
Teruo he i wc 4 Subroutines 2
Cane Uy Pe 7 5 GuiAppications (Optional 2»
‘spn cp Sate ase ation
wee pe soe ese eg pene © Selection a
‘eps yarn pe tet oon
Ferma fares ney 1 eration s
ei 2017 8 Desgninglgorthms 2
essay 6418 123820987 eae a
‘nd ep by Gyo rnp
‘Act mardi hs pti afm he rh ry 0 Testing a
IBEW 31641783 pete 1 Mays 105
ae su Ss ee 12 Prevalence Tak Preperation na
Steer dp nce a, 13 Baaminaton Practice 18
‘Sieur nae nein pei rd es her Solutions Pe
ete ane Pe oo ye esc oan AopendiThintrRelernce 33
128 the pr mado Cant ental Eni
[Aesminaon se quai ge mace ion ler er at
‘tourna ne ten yasmin tems me
‘Micctoenmen iceman
hows sea) pdr wing emt
"CRI ty ms nen rbot or ron ye
usar Sea owe wo aed hemo
‘ifertne pnd css po oblige Ute re
aneh foetal eed iu ermine he Poe
hae utc Deg nd Ra e908 when Be
be wpe et eye nora pent
‘logy econ epee tinge giIntroduction
nen Fichard Morgan wrote the Vsual Basic edton ofthis book head toms in mind
“The fest wasta pride aprogammingback that special coved the materia leant
{othe Cambridge GCSE® and 0 Level Computer Science slabuses (0479/2210 The second,
nd perhaps mere important, aim was o pou the student with start the excing
“nd rewarding process ofbeingableto create ther aun computer programs. These ate
Scmirable sms that Pape have not been lestin this cert aration int Python 3
There are afew subtle changestothe fou grams and the pseudocode in his Python
teiton but fundamental, nherever posse the algorithms used are the sre as thosein
the\Vaul Base book Tis haste eretingoucomethatstudertscan be taught the sme
tmaterl ina Cambri ISCSE snd Level Computer cence class tha mixture af the
{wo books, They can warkonsolutonsin groups and then go and we thecodefor woking
Implementations ofthel algetsin ether inguage
Phonan sual Basi have cient svengths and weaknesses and so they lend
themselves sity diferent approaches, Forthiseasen, thechapershave been slightly
rrorderedin this book. Te orginal Chapter hasbeen spit: only text-based programing
isimroduced in chapter hile howto produce GUishas been moved tothe optional
Chapters. Theeis also an adionalchapteron preparing frthe pre-eease tas. lotr
‘Chapter tes remain the same easy comparison shouldbe possible
Language
“The stax and stctures seta implement proprarming ecriques wl vary acoss
feet languages. This book's entry based around Python 3,one othe thee
recommended angusgesforthe Cambridge international AS anc A Level sabus Python
Ties at score the penile hat code should cary trea, Thc means tat in many ways
Ileveryclone to pseudocode.
“The pseudocode structure ven the Cambri I6CSE and Level Compute cence
nomination popes uses a language neutral sie, Ahoughstudents are expected tobe
femitar wt hes andbeableto read ad olen the logic easly, they arenot expected to
proce ter own peeudacade inexact ths syle Psaudocode smeantto bea way of
Expressing clearly the lope of programy erm the worse stax.
Python azo has recommended style guide thatcanbefound at
tps python orsteupepstoe> 008
Het fo example, tis recommended that Python programmers name functions and
Variables wth descrigtivallowercase characters separated by underscores, for example
mny_variable Thisstylsnever used in Cambie GCSE and O Level omnputer Science
ssidocode; However, students should not be marked down for ding sointheirown
esudocode ste coulbe very conksing to keep swapping naming conventions, this book
[sues that students ef goingto stick, wherever posse to thecorec Python syle but
betel enough hiner to be ale to read oer pseudocode sis tisrecommended
‘that when preparing for exams, students ensure they are aware ofthe exam board variable
raingstye Chapter 3 inthis book provides some examination syle questons
Examination focused
‘Te Cambridge IGCSE and O Level Computer Science cousevil test computational hokng
Independent of any specie pragramminglanguage. wl do this through the use of progran