Page 5 - Python for Everybody
P. 5
Contents
1
Why should you learn to write programs? 1
1.1 Creativityandmotivation....................... 2
1.2 Computerhardwarearchitecture ................... 3
1.3 Understandingprogramming ..................... 4
1.4 Wordsandsentences.......................... 5
1.5 ConversingwithPython........................ 6
1.6 Terminology: Interpreterandcompiler. . . . . . . . . . . . . . . . 8
1.7 Writingaprogram........................... 10
1.8 Whatisaprogram? .......................... 10
1.9 Thebuildingblocksofprograms .................... 11
1.10 Whatcouldpossiblygowrong?.................... 12
1.11 Debugging ............................... 14
1.12 Thelearningjourney.......................... 15
1.13 Glossary................................. 15
1.14 Exercises ................................ 16
Variables, expressions, and statements 19
2.1 Valuesandtypes............................ 19
2.2 Variables ................................ 20
2.3 Variablenamesandkeywords...................... 21
2.4 Statements ................................ 21
2.5 Operatorsandoperands........................ 22
2.6 Expressions............................... 23
2.7 Orderofoperations .......................... 23
2.8 Modulusoperator ........................... 24
2.9 Stringoperations............................ 24
2
v