Snake Wrangling for Kids - Learning to Program with Python 2, linux-v0.7.2

Contents Preface iii 1 Notallsnakeswillsquishyou 1 1.1 AFewWordsAboutLanguage ... 3 1.2 TheOrderofNon-venomousConstrictingSerpentes... 3 1.3 YourfirstPythonprogram... 4 1.4 YourSecondPythonprogram...thesameagain?... 5 2 8multipliedby3.57equals... 9 2.1 Useofbracketsand“OrderofOperations”...11 2.2 There’snothingsofickleasavariable...13 2.3 UsingVariable....15 2.4 APieceofString?.....16 2.5 TrickswithStrings....17 2.6 Notquiteashoppinglist....19 2.7 TuplesandLists...22 2.8 Thingstotry....23 3 Turtles,andotherslowmovingcreatures 25 3.1 Thingstotry....31 4 Howtoaskaquestion 33 4.1 Dothis...orELSE!!!...34 i 4.2 Dothis...ordothis...orELSE!!!...35 4.3 Combiningconditions...36 4.4 Emptiness...36 4.5 What’sthedifference...?....38 5 Againandagain 41 5.1 Whenisablocknotsquare?.....44 5.2 Whilewe’retalkingaboutlooping...49 5.3 Thingstotry....50 6 Sortoflikerecycling... 53 6.1 BitsandPieces...57 6.2 Modules....58 6.3 Thingstotry....61 7 AshortchapteraboutFiles 63 8 Turtlesgalore 65 8.1 Colouringin.....69 8.2 Darkness....72 8.3 Fillingthings....72 8.4 Thingstotry....77 9 Abitgraphic 79 9.1 QuickDraw.....80 9.2 SimpleDrawing...83 9.3 DrawingBoxes ...84 9.4 DrawingArcs....88 9.5 DrawingOvals....90 9.6 DrawingPolygons.....92 9.7 DrawingImages...93 9.8 BasicAnimation .....95 ii 9.9 Reactingtoevents...98 10Wheretogofromhere 101 APythonKeywords 103 BBuilt-inFunctions 115 CAFewPythonModules 123 DAnswersto“Thingstotry” 133
pdf 文件大小:1.22MB