(eBook PDF) Practice of Computing Using Python, The 3rd Edition download pdf
(eBook PDF) Practice of Computing Using Python, The 3rd Edition download pdf
com
https://ebookluna.com/product/ebook-pdf-practice-of-
computing-using-python-the-3rd-edition/
OR CLICK HERE
DOWLOAD NOW
https://ebookluna.com/product/ebook-pdf-introduction-to-programming-
using-python-an-1/
ebookluna.com
https://ebookluna.com/product/ebook-pdf-numerical-analysis-
mathematics-of-scientific-computing-3rd/
ebookluna.com
https://ebookluna.com/product/ebook-pdf-the-practice-of-creative-
writings-3rd-edition/
ebookluna.com
https://ebookluna.com/download/the-physics-of-computing-ebook-pdf/
ebookluna.com
(eBook PDF) The Doctor of Nursing Practice Essentials 3rd
Edition
https://ebookluna.com/product/ebook-pdf-the-doctor-of-nursing-
practice-essentials-3rd-edition/
ebookluna.com
https://ebookluna.com/product/ebook-pdf-python-programming-in-
context-3rd-edition/
ebookluna.com
https://ebookluna.com/product/python-programming-in-context-3rd-
edition-ebook-pdf/
ebookluna.com
https://ebookluna.com/product/ebook-pdf-the-speaker-the-tradition-and-
practice-of-public-speaking-3rd/
ebookluna.com
https://ebookluna.com/product/ebook-pdf-the-nurse-the-math-the-meds-
drug-calculations-using-dimensional-analysis-3rd-edition/
ebookluna.com
THE PRACTICE OF COMPUTING USING
3RD EDITION
WILLIAM RICHARD
PUNCH • ENBODY
C O N T E N T S
•
VIDEONOTES xxiv
PREFACE xxv
PREFACE TO THE SECOND EDITION xxix
1.0.1 Data Manipulation xxx
1.0.2 Problem Solving and Case Studies xxx
1.0.3 Code Examples xxx
1.0.4 Interactive Sessions xxxi
1.0.5 Exercises and Programming Projects xxxi
1.0.6 Self-Test Exercises xxxi
1.0.7 Programming Tips xxxi
vii
viii CONTENTS
P A R T 2 S TA RT I N G T O P R O G R A M 35
Chapter 1 Beginnings 37
1.1 Practice, Practice, Practice 37
1.2 QuickStart, the Circumference Program 38
1.2.1 Examining the Code 40
1.3 An Interactive Session 42
1.4 Parts of a Program 43
1.4.1 Modules 43
1.4.2 Statements and Expressions 43
1.4.3 Whitespace 45
1.4.4 Comments 46
1.4.5 Special Python Elements: Tokens 46
1.4.6 Naming Objects 48
1.4.7 Recommendations on Naming 49
1.5 Variables 49
1.5.1 Variable Creation and Assignment 50
1.6 Objects and Types 53
1.6.1 Numbers 55
1.6.2 Other Built-In Types 57
1.6.3 Object Types: Not Variable Types 58
1.6.4 Constructing New Values 60
CONTENTS ix
1.7 Operators 61
1.7.1 Integer Operators 61
1.7.2 Floating-Point Operators 64
1.7.3 Mixed Operations 64
1.7.4 Order of Operations and Parentheses 65
1.7.5 Augmented Assignment Operators: A Shortcut! 66
1.8 Your First Module, Math 68
1.9 Developing an Algorithm 69
1.9.1 New Rule—Testing 73
1.10 Visual Vignette: Turtle Graphics 74
1.11 What’s Wrong with My Code? 75
Chapter 2 Control 87
2.1 QuickStart Control 87
2.1.1 Selection 87
2.1.2 Booleans for Decisions 89
2.1.3 The if Statement 89
2.1.4 Example: What Lead Is Safe in Basketball? 92
2.1.5 Repetition 96
2.1.6 Example: Finding Perfect Numbers 100
2.1.7 Example: Classifying Numbers 105
2.2 In-Depth Control 109
2.2.1 True and False: Booleans 109
2.2.2 Boolean Variables 110
2.2.3 Relational Operators 110
2.2.4 Boolean Operators 115
2.2.5 Precedence 116
2.2.6 Boolean Operators Example 117
2.2.7 Another Word on Assignments 120
2.2.8 The Selection Statement for Decisions 122
2.2.9 More on Python Decision Statements 122
2.2.10 Repetition: the while Statement 126
2.2.11 Sentinel Loop 136
2.2.12 Summary of Repetition 136
2.2.13 More on the for Statement 137
2.2.14 Nesting 140
2.2.15 Hailstone Sequence Example 142
2.3 Visual Vignette: Plotting Data with Pylab 143
2.3.1 First Plot and Using a List 144
2.3.2 More Interesting Plot: A Sine Wave 145
x CONTENTS
P A R T 3 D AT A S T R U C T U R E S A N D F U N C T I O N S 187
Chapter 4 Working with Strings 189
4.1 The String Type 190
4.1.1 The Triple-Quote String 190
4.1.2 Nonprinting Characters 191
4.1.3 String Representation 191
4.1.4 Strings as a Sequence 192
4.1.5 More Indexing and Slicing 193
4.1.6 Strings Are Iterable 198
CONTENTS xi
P A R T 4 C L A S S E S , M A K I N G Y O U R O W N D AT A S T R U C T U R E S
AND ALGORITHMS 527
Chapter 11 Introduction to Classes 529
11.1 QuickStart: Simple Student Class 529
11.2 Object-Oriented Programming 530
11.2.1 Python Is Object-Oriented! 530
11.2.2 Characteristics of OOP 531
11.3 Working with OOP 531
11.3.1 Class and Instance 531
11.4 Working with Classes and Instances 532
11.4.1 Built-In Class and Instance 532
11.4.2 Our First Class 534
11.4.3 Changing Attributes 536
11.4.4 The Special Relationship Between an Instance and
Class: instance-of 537
11.5 Object Methods 540
11.5.1 Using Object Methods 540
11.5.2 Writing Methods 541
11.5.3 The Special Argument self 542
11.5.4 Methods Are the Interface to a Class Instance 544
11.6 Fitting into the Python Class Model 545
11.6.1 Making Programmer-Defined Classes 545
11.6.2 A Student Class 545
11.6.3 Python Standard Methods 546
11.6.4 Now There Are Three: Class Designer, Programmer,
and User 550
11.7 Example: Point Class 551
11.7.1 Construction 553
11.7.2 Distance 553
11.7.3 Summing Two Points 553
11.7.4 Improving the Point Class 554
11.8 Python and OOP 558
11.8.1 Encapsulation 558
11.8.2 Inheritance 559
11.8.3 Polymorphism 559
11.9 Python and Other OOP Languages 559
11.9.1 Public versus Private 559
11.9.2 Indicating Privacy Using Double Underscores (__) 560
CONTENTS xvii
APPENDICES 753
Appendix A Getting and Using Python 753
A.1 About Python 753
A.1.1 History 753
A.1.2 Python 3 753
A.1.3 Python Is Free and Portable 754
A.1.4 Installing Anaconda 756
A.1.5 Starting Our Python IDE: Spyder 756
A.1.6 Working with Python 757
A.1.7 Making a Program 760
A.2 The IPython Console 762
A.2.1 Anatomy of an iPython Session 763
A.2.2 Your Top Three iPython Tips 764
A.2.3 Completion and the Tab Key 764
A.2.4 The ? Character 766
A.2.5 More iPython Tips 766
A.3 Some Conventions for This Book 769
A.3.1 Interactive Code 770
A.3.2 Program: Written Code 770
A.3.3 Combined Program and Output 770
A.4 Summary 771
Appendix B Simple Drawing with Turtle Graphics 773
B.0.1 What Is a Turtle? 773
B.0.2 Motion 775
B.0.3 Drawing 775
B.0.4 Color 777
B.0.5 Drawing with Color 779
B.0.6 Other Commands 781
B.1 Tidbits 783
B.1.1 Reset/Close the Turtle Window 783
Appendix C What’s Wrong with My Code? 785
C.1 It’s Your Fault! 785
C.1.1 Kinds of Errors 785
C.1.2 “Bugs” and Debugging 787
C.2 Debugging 789
C.2.1 Testing for Correctness 789
C.2.2 Probes 789
C.2.3 Debugging with Spyder Example 1 789
C.2.4 Debugging Example 1 Using print() 793
Other documents randomly have
different content
économies devaient-ils s'attendre à les sacrifier d'abord pour le
paiement des diverses taxes; puis, tout l'argent disparaîtrait
jusqu'au dernier shilling lors du règlement des fermages.
La conséquence de cet état de choses fut que le mouvement
nationaliste tendit à s'accentuer dans les comtés. C'est ce qui arrive
toutes les fois qu'un nuage de misère se lève à l'horizon des
campagnes irlandaises. En maint endroit retentirent les
récriminations mêlées aux cris désespérés des partisans de la ligue
agraire. De terribles menaces furent proférées contre les
propriétaires du sol, qu'ils fussent ou non étrangers, et on n'a pas
oublié que les landlords écossais ou anglais étaient considérés
comme tels.
Cette année-là, en juin, à Westport, les gens, ameutés par la
faim, venaient de s'écrier: «Accrochez-vous d'une poigne solide à
vos fermes!» et le mot d'ordre qui courait à travers les campagnes,
c'était: «la terre aux paysans!»
Quelques scènes de désordre éclatèrent sur les territoires du
Donegal, du Sligo, du Galway. Le Kerry n'en fut point exempt. Très
effrayées, Grand'mère, Martine et Kitty virent trop souvent Murdock
quitter la ferme, à la nuit close, et n'y reparaître que le lendemain,
fatigué par de longues étapes, et plus sombre, plus ulcéré que
jamais. Il revenait de ces meetings organisés dans les principales
bourgades, où l'on prêchait la révolte, le soulèvement contre les
lords, le boycottage général, qui obligerait les propriétaires à laisser
leurs terres en friche.
IL FALLUT RENTRER LES ANIMAUX A L'ÉTABLE. (Page 186.)