86% found this document useful (7 votes)
364 views

Instant download (eBook PDF) Practice of Computing Using Python, The 3rd Edition pdf all chapter

Computing

Uploaded by

scalonminora13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
86% found this document useful (7 votes)
364 views

Instant download (eBook PDF) Practice of Computing Using Python, The 3rd Edition pdf all chapter

Computing

Uploaded by

scalonminora13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

Visit https://ebookluna.

com to download the full version and


explore more ebooks

(eBook PDF) Practice of Computing Using Python, The


3rd Edition

_____ Click the link below to download _____


https://ebookluna.com/product/ebook-pdf-practice-of-
computing-using-python-the-3rd-edition/

Explore and download more ebooks at ebookluna.com


Here are some recommended products that might interest you.
You can download now and explore!

(eBook PDF) Introduction to Programming Using Python An 1

https://ebookluna.com/product/ebook-pdf-introduction-to-programming-
using-python-an-1/

ebookluna.com

(eBook PDF) Numerical Analysis: Mathematics of Scientific


Computing 3rd

https://ebookluna.com/product/ebook-pdf-numerical-analysis-
mathematics-of-scientific-computing-3rd/

ebookluna.com

(eBook PDF) The Practice of Creative Writings 3rd Edition

https://ebookluna.com/product/ebook-pdf-the-practice-of-creative-
writings-3rd-edition/

ebookluna.com

The Physics of Computing 1st Edition Marilyn Wolf - eBook


PDF

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

(eBook PDF) Python Programming in Context 3rd Edition

https://ebookluna.com/product/ebook-pdf-python-programming-in-
context-3rd-edition/

ebookluna.com

Python Programming in Context, 3rd Edition (eBook PDF)

https://ebookluna.com/product/python-programming-in-context-3rd-
edition-ebook-pdf/

ebookluna.com

(eBook PDF) The Speaker: The Tradition and Practice of


Public Speaking 3rd

https://ebookluna.com/product/ebook-pdf-the-speaker-the-tradition-and-
practice-of-public-speaking-3rd/

ebookluna.com

(eBook PDF) The Nurse, The Math, The Meds: Drug


Calculations Using Dimensional Analysis 3rd Edition

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

PART 1 THINKING ABOUT COMPUTING 1


Chapter 0 The Study of Computer Science 3
0.1 Why Computer Science? 3
0.1.1 Importance of Computer Science 3
0.1.2 Computer Science Around You 4
0.1.3 Computer “Science” 4
0.1.4 Computer Science Through Computer Programming 6
0.2 The Difficulty and Promise of Programming 6
0.2.1 Difficulty 1: Two Things at Once 6
0.2.2 Difficulty 2: What Is a Good Program? 9
0.2.3 The Promise of a Computer Program 10
0.3 Choosing a Computer Language 11
0.3.1 Different Computer Languages 11
0.3.2 Why Python? 11
0.3.3 Is Python the Best Language? 13
0.4 What Is Computation? 13
0.5 What Is a Computer? 13

vii
viii CONTENTS

0.5.1 Computation in Nature 14


0.5.2 The Human Computer 17
0.6 The Modern, Electronic Computer 18
0.6.1 It’s the Switch! 18
0.6.2 The Transistor 19
0.7 A High-Level Look at a Modern Computer 24
0.8 Representing Data 26
0.8.1 Binary Data 26
0.8.2 Working with Binary 27
0.8.3 Limits 28
0.8.4 Representing Letters 29
0.8.5 Representing Other Data 30
0.8.6 What Does a Number Represent? 31
0.8.7 How to Talk About Quantities of Data 32
0.8.8 How Much Data Is That? 32
0.9 Overview of Coming Chapters 34

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

2.4 Computer Science Perspectives: Minimal Universal Computing 147


2.4.1 Minimal Universal Computing 147
2.5 What’s Wrong with My Code? 148
Chapter 3 Algorithms and Program Development 161
3.1 What Is an Algorithm? 161
3.1.1 Example Algorithms 162
3.2 Algorithm Features 163
3.2.1 Algorithm versus Program 163
3.2.2 Qualities of an Algorithm 165
3.2.3 Can We Really Do All That? 167
3.3 What Is a Program? 167
3.3.1 Readability 167
3.3.2 Robust 171
3.3.3 Correctness 172
3.4 Strategies for Program Design 173
3.4.1 Engage and Commit 173
3.4.2 Understand, Then Visualize 174
3.4.3 Think Before You Program 175
3.4.4 Experiment 175
3.4.5 Simplify 175
3.4.6 Stop and Think 177
3.4.7 Relax: Give Yourself a Break 177
3.5 A Simple Example 177
3.5.1 Build the Skeleton 178
3.5.2 Output 178
3.5.3 Input 179
3.5.4 Doing the Calculation 181

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

4.2 String Operations 199


4.2.1 Concatenation (+) and Repetition (*) 199
4.2.2 Determining When + Indicates Addition or
Concatenation? 200
4.2.3 Comparison Operators 201
4.2.4 The in Operator 202
4.2.5 String Collections Are Immutable 203
4.3 A Preview of Functions and Methods 205
4.3.1 A String Method 205
4.3.2 Determining Method Names and Method Arguments 208
4.3.3 String Methods 210
4.3.4 String Functions 210
4.4 Formatted Output for Strings 211
4.4.1 Descriptor Codes 212
4.4.2 Width and Alignment Descriptors 213
4.4.3 Floating-Point Precision Descriptor 214
4.5 Control and Strings 215
4.6 Working with Strings 218
4.6.1 Example: Reordering a Person’s Name 218
4.6.2 Palindromes 220
4.7 More String Formatting 223
4.8 Unicode 226
4.9 A GUI to Check a Palindrome 228
4.10 What’s Wrong with My Code? 232
Chapter 5 Functions—QuickStart 245
5.1 What Is a Function? 245
5.1.1 Why Have Functions? 246
5.2 Python Functions 247
5.3 Flow of Control with Functions 250
5.3.1 Function Flow in Detail 251
5.3.2 Parameter Passing 251
5.3.3 Another Function Example 253
5.3.4 Function Example: Area of a Triangle 254
5.3.5 Functions Calling Functions 258
5.3.6 When to Use a Function 259
5.3.7 What If There Is No Return Statement? 260
5.3.8 What If There Are Multiple Return Statements? 260
xii CONTENTS

5.4 Visual Vignette: Turtle Flag 261


5.5 What’s Wrong with My Code? 262
Chapter 6 Files and Exceptions I 271
6.1 What Is a File? 271
6.2 Accessing Files: Reading Text Files 271
6.2.1 What’s Really Happening? 272
6.3 Accessing Files: Writing Text Files 273
6.4 Reading and Writing Text Files in a Program 274
6.5 File Creation and Overwriting 275
6.5.1 Files and Functions Example: Word Puzzle 276
6.6 First Cut, Handling Errors 282
6.6.1 Error Names 283
6.6.2 The try-except Construct 283
6.6.3 try-except Flow of Control 284
6.6.4 Exception Example 285
6.7 Example: Counting Poker Hands 288
6.7.1 Program to Count Poker Hands 291
6.8 GUI to Count Poker Hands 299
6.8.1 Count Hands Function 300
6.8.2 The Rest of the GUI Code 302
6.9 Error Check Float Input 304
6.10 What’s Wrong with My Code? 304
Chapter 7 Lists and Tuples 311
7.1 What Is a List? 311
7.2 What You Already Know How To Do With Lists 313
7.2.1 Indexing and Slicing 314
7.2.2 Operators 315
7.2.3 Functions 317
7.2.4 List Iteration 318
7.3 Lists Are Different than Strings 319
7.3.1 Lists Are Mutable 319
7.3.2 List Methods 320
7.4 Old and New Friends: Split and Other Functions and Methods 325
7.4.1 Split and Multiple Assignment 325
7.4.2 List to String and Back Again, Using join 326
7.4.3 The Sorted Function 327
CONTENTS xiii

7.5 Working with Some Examples 328


7.5.1 Anagrams 328
7.5.2 Example: File Analysis 334
7.6 Mutable Objects and References 340
7.6.1 Shallow versus Deep Copy 345
7.6.2 Mutable versus Immutable 349
7.7 Tuples 350
7.7.1 Tuples from Lists 352
7.7.2 Why Tuples? 353
7.8 Lists: The Data Structure 353
7.8.1 Example Data Structure 354
7.8.2 Other Example Data Structures 355
7.9 Algorithm Example: U.S. EPA Automobile Mileage Data 355
7.9.1 CSV Module 365
7.10 Visual Vignette: Plotting EPA Data 366
7.11 List Comprehension 368
7.11.1 Comprehensions, Expressions, and the Ternary
Operator 370
7.12 Visual Vignette: More Plotting 370
7.12.1 Pylab Arrays 371
7.12.2 Plotting Trigonometric Functions 373
7.13 GUI to Find Anagrams 374
7.13.1 Function Model 374
7.13.2 Controller 375
7.14 What’s Wrong with My Code? 377
Chapter 8 More on Functions 395
8.1 Scope 395
8.1.1 Arguments, Parameters, and Namespaces 397
8.1.2 Passing Mutable Objects 399
8.1.3 Returning a Complex Object 401
8.1.4 Refactoring evens 403
8.2 Default Values and Parameters as Keywords 404
8.2.1 Example: Default Values and Parameter Keywords 405
8.3 Functions as Objects 407
8.3.1 Function Annotations 408
8.3.2 Docstrings 409
xiv CONTENTS

8.4 Example: Determining a Final Grade 410


8.4.1 The Data 410
8.4.2 The Design 410
8.4.3 Function: weighted_grade 411
8.4.4 Function: parse_line 411
8.4.5 Function: main 412
8.4.6 Example Use 413
8.5 Pass “by Value” or “by Reference” 413
8.6 What’s Wrong with My Code? 414
Chapter 9 Dictionaries and Sets 423
9.1 Dictionaries 423
9.1.1 Dictionary Example 424
9.1.2 Python Dictionaries 425
9.1.3 Dictionary Indexing and Assignment 425
9.1.4 Operators 426
9.1.5 Ordered Dictionaries 431
9.2 Word Count Example 432
9.2.1 Count Words in a String 432
9.2.2 Word Frequency for Gettysburg Address 433
9.2.3 Output and Comments 437
9.3 Periodic Table Example 438
9.3.1 Working with CSV Files 439
9.3.2 Algorithm Overview 441
9.3.3 Functions for Divide and Conquer 441
9.4 Sets 445
9.4.1 History 445
9.4.2 What’s in a Set? 445
9.4.3 Python Sets 446
9.4.4 Methods, Operators, and Functions for Python Sets 447
9.4.5 Set Methods 447
9.5 Set Applications 452
9.5.1 Relationship between Words of Different 452
9.5.2 Output and Comments 456
9.6 Scope: The Full Story 456
9.6.1 Namespaces and Scope 457
9.6.2 Search Rule for Scope 457
9.6.3 Local 457
9.6.4 Global 458
9.6.5 Built-Ins 462
9.6.6 Enclosed 463
CONTENTS xv

9.7 Using zip to Create Dictionaries 464


9.8 Dictionary and Set Comprehensions 465
9.9 Visual Vignette: Bar Graph of Word Frequency 466
9.9.1 Getting the Data Right 466
9.9.2 Labels and the xticks Command 467
9.9.3 Plotting 467
9.10 GUI to Compare Files 468
9.10.1 Controller and View 469
9.10.2 Function Model 471
9.11 What’s Wrong with My Code? 473
Chapter 10 More Program Development 483
10.1 Introduction 483
10.2 Divide and Conquer 483
10.2.1 Top-Down Refinement 484
10.3 The Breast Cancer Classifier 484
10.3.1 The Problem 484
10.3.2 The Approach: Classification 485
10.3.3 Training and Testing the Classifier 485
10.3.4 Building the Classifier 485
10.4 Designing the Classifier Algorithm 487
10.4.1 Divided, now Conquer 490
10.4.2 Data Structures 491
10.4.3 File Format 491
10.4.4 The make_training_set Function 492
10.4.5 The make_test_set Function 496
10.4.6 The train_classifier Function 497
10.4.7 train_classifier, Round 2 499
10.4.8 Testing the Classifier on New Data 502
10.4.9 The report_results Function 506
10.5 Running the Classifier on Full Data 508
10.5.1 Training versus Testing 508
10.6 Other Interesting Problems 512
10.6.1 Tag Clouds 512
10.6.2 S&P 500 Predictions 514
10.6.3 Predicting Religion with Flags 517
10.7 GUI to Plot the Stock Market 519
10.7.1 Function Model 519
10.7.2 Controller and View 521
Visit https://ebookluna.com
now to explore a diverse
collection of ebooks available
in formats like PDF, EPUB, and
MOBI, compatible with all
devices. Don’t miss the chance
to enjoy exciting offers and
quickly download high-quality
materials in just a few simple
steps!
xvi CONTENTS

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

11.9.3 Python’s Philosophy 561


11.9.4 Modifying an Instance 562
11.10 What’s Wrong with My Code? 562
Chapter 12 More on Classes 571
12.1 More About Class Properties 571
12.1.1 Rational Number (Fraction) Class Example 572
12.2 How Does Python Know? 574
12.2.1 Classes, Types, and Introspection 574
12.2.2 Remember Operator Overloading 577
12.3 Creating Your Own Operator Overloading 577
12.3.1 Mapping Operators to Special Methods 578
12.4 Building the Rational Number Class 581
12.4.1 Making the Class 581
12.4.2 Review Fraction Addition 583
12.4.3 Back to Adding Fractions 586
12.4.4 Equality and Reducing Rationals 590
12.4.5 Divide and Conquer at Work 593
12.5 What Doesn’t Work (Yet) 593
12.5.1 Introspection 594
12.5.2 Repairing int + Rational Errors 596
12.6 Inheritance 598
12.6.1 The “Find the Attribute” Game 599
12.6.2 Using Inheritance 602
12.6.3 Example: The Standard Model 603
12.7 What’s Wrong with My Code? 608
Chapter 13 Program Development with Classes 615
13.1 Predator–Prey Problem 615
13.1.1 The Rules 616
13.1.2 Simulation Using Object-Oriented Programming 617
13.2 Classes 617
13.2.1 Island Class 617
13.2.2 Predator and Prey, Kinds of Animals 619
13.2.3 Predator and Prey Classes 622
13.2.4 Object Diagram 623
13.2.5 Filling the Island 623
13.3 Adding Behavior 626
13.3.1 Refinement: Add Movement 626
13.3.2 Refinement: Time Simulation Loop 629
xviii CONTENTS

13.4 Refinement: Eating, Breeding, and Keeping Time 630


13.4.1 Improved Time Loop 631
13.4.2 Breeding 634
13.4.3 Eating 636
13.4.4 The Tick of the Clock 637
13.5 Refinement: How Many Times to Move? 638
13.6 Visual Vignette: Graphing Population Size 639

PART 5 BEING A BETTER PROGRAMMER 643


Chapter 14 Files and Exceptions II 645
14.1 More Details on Files 645
14.1.1 Other File Access Methods, Reading 647
14.1.2 Other File Access Methods, Writing 649
14.1.3 Universal New Line Format 651
14.1.4 Moving Around in a File 652
14.1.5 Closing a File 654
14.1.6 The with Statement 654
14.1.7 Text File Encodings; Unicode 655
14.2 CSV Files 656
14.2.1 CSV Module 657
14.2.2 CSV Reader 658
14.2.3 CSV Writer 659
14.2.4 Example: Update Some Grades 659
14.3 Module: os 661
14.3.1 Directory (Folder) Structure 662
14.3.2 os Module Functions 663
14.3.3 os Module Example 665
14.4 More on Exceptions 667
14.4.1 Basic Exception Handling 668
14.4.2 A Simple Example 669
14.4.3 Events 671
14.4.4 A Philosophy Concerning Exceptions 672
14.5 Exception: else and finally 673
14.5.1 finally and with 673
14.5.2 Example: Refactoring the Reprompting of a File Name 673
14.6 More on Exceptions 675
14.6.1 Raise 675
14.6.2 Create Your Own 676
14.7 Example: Password Manager 677
CONTENTS xix

Chapter 15 Recursion: Another Control Mechanism 687


15.1 What Is Recursion? 687
15.2 Mathematics and Rabbits 689
15.3 Let’s Write Our Own: Reversing a String 692
15.4 How Does Recursion Actually Work? 694
15.4.1 Stack Data Structure 695
15.4.2 Stacks and Function Calls 697
15.4.3 A Better Fibonacci 699
15.5 Recursion in Figures 700
15.5.1 Recursive Tree 700
15.5.2 Sierpinski Triangles 702
15.6 Recursion to Non-recursion 703
15.7 GUI for Turtle Drawing 704
15.7.1 Using Turtle Graphics to Draw 704
15.7.2 Function Model 705
15.7.3 Controller and View 706
Chapter 16 Other Fun Stuff with Python 709
16.1 Numbers 709
16.1.1 Fractions 710
16.1.2 Decimal 714
16.1.3 Complex Numbers 718
16.1.4 Statistics Module 720
16.1.5 Random Numbers 722
16.2 Even More on Functions 724
16.2.1 Having a Varying Number of Parameters 725
16.2.2 Iterators and Generators 728
16.2.3 Other Functional Programming Ideas 733
16.2.4 Some Functional Programming Tools 734
16.2.5 Decorators: Functions Calling Functions 736
16.3 Classes 741
16.3.1 Properties 742
16.3.2 Serializing an Instance: pickle 745
16.4 Other Things in Python 748
16.4.1 Data Types 748
16.4.2 Built-in Modules 748
16.4.3 Modules on the Internet 749
Chapter 17 The End, or Perhaps the Beginning 751
xx CONTENTS

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
CONTENTS xxi

C.2.5 Debugging with Spyder Example 2 794


C.2.6 More Debugging Tips 802
C.3 More about Testing 803
C.3.1 Testing Is Hard! 804
C.3.2 Importance of Testing 805
C.3.3 Other Kinds of Testing 805
C.4 What’s Wrong with My Code? 805
C.4.1 Chapter 1: Beginnings 805
C.4.2 Chapter 2: Control 807
C.4.3 Chapter 4: Strings 808
C.4.4 Chapter 5: Functions 809
C.4.5 Chapter 6: Files and Exceptions 810
C.4.6 Chapter 7: Lists and Tuples 811
C.4.7 Chapter 8: More Functions 812
C.4.8 Chapter 9: Dictionaries 813
C.4.9 Chapter 11: Classes I 814
C.4.10 Chapter 12: Classes II 815
Appendix D Pylab: A Plotting and Numeric Tool 817
D.1 Plotting 817
D.2 Working with pylab 818
D.2.1 Plot Command 818
D.2.2 Colors, Marks, and Lines 819
D.2.3 Generating X-Values 819
D.2.4 Plot Properties 820
D.2.5 Tick Labels 821
D.2.6 Legend 822
D.2.7 Bar Graphs 824
D.2.8 Histograms 824
D.2.9 Pie Charts 825
D.2.10 How Powerful Is pylab? 826
Appendix E Quick Introduction to Web-based User Interfaces 829
E.0.1 MVC Architecture 830
E.1 Flask 830
E.2 QuickStart Flask, Hello World 831
E.2.1 What Just Happened? 832
E.2.2 Multiple Routes 833
E.2.3 Stacked Routes, Passing Address Arguments 835
E.3 Serving Up Real HTML Pages 836
E.3.1 A Little Bit of HTML 836
E.3.2 HTML Tags 836
xxii CONTENTS

E.3.3 Flask Returning Web Pages 838


E.3.4 Getting Arguments into Our Web Pages 839
E.4 Active Web Pages 841
E.4.1 Forms in wtforms 841
E.4.2 A Good Example Goes a Long Way 842
E.4.3 Many Fields Example 847
E.5 Displaying and Updating Images 852
E.6 Odds and Ends 857
Appendix F Table of UTF-8 One Byte Encodings 859
Appendix G Precedence 861
Appendix H Naming Conventions 863
H.1 Python Style Elements 864
H.2 Naming Conventions 864
H.2.1 Our Added Naming Conventions 864
H.3 Other Python Conventions 865
Appendix I Check Yourself Solutions 867
I.1 Chapter 1 867
Variables and Assignment 867
Types and Operators 867
I.2 Chapter 2 868
Basic Control Check 868
Loop Control Check 868
More Control Check 868
for and range Check 868
I.3 Chapter 4 869
Slicing Check 869
String Comparison Check 869
I.4 Chapter 5 869
Simple Functions Check 869
I.5 Chapter 6 869
Exception Check 869
Function Practice with Strings 870
I.6 Chapter 7 870
Basic Lists Check 870
Lists and Strings Check 870
Mutable List Check 870
CONTENTS xxiii

I.7 Chapter 8 870


Passing Mutables Check 870
More on Functions Check 871
I.8 Chapter 9 871
Dictionary Check 871
Set Check 871
I.9 Chapter 11 871
Basic Classes Check 871
Defining Special Methods 871
I.10 Chapter 12 872
Check Defining Your Own Operators 872
I.11 Chapter 14 872
Basic File Operations 872
Basic Exception Control 872
INDEX 873
V I D E O N O T E S

VideoNote 0.1 Getting Python 13
VideoNote 1.1 Simple Arithmetic 64
VideoNote 1.2 Solving Your First Problem 73
VideoNote 2.1 Simple Control 96
VideoNote 2.2 Nested Control 140
VideoNote 3.1 Algorithm Decomposition 177
VideoNote 3.2 Algorithm Development 185
VideoNote 4.1 Playing with Strings 210
VideoNote 4.2 String Formatting 214
VideoNote 5.1 Simple Functions 251
VideoNote 5.2 Problem Design Using Functions 261
VideoNote 6.1 Reading Files 272
VideoNote 6.2 Simple Exception Handling 285
VideoNote 7.1 List Operations 327
VideoNote 7.2 List Application 349
VideoNote 8.1 More on Parameters 405
VideoNote 9.1 Using a Dictionary 437
VideoNote 9.2 More Dictionaries 465
VideoNote 10.1 Program Development: Tag Cloud 512
VideoNote 11.1 Designing a Class 545
VideoNote 11.2 Improving a Class 554
VideoNote 12.1 Augmenting a Class 593
VideoNote 12.2 Create a Class 596
VideoNote 13.1 Improve Simulation 623
VideoNote 14.1 Dictionary Exceptions 669
VideoNote 15.1 Recursion 692
VideoNote 16.1 Properties 742

xxiv
Other documents randomly have
different content
Fig. 24.— Fig. 25.—Kernel Fig. 26.—Indian Corn.
Sprouting of Indian Corn. Caulicle at c; roots emerging at m; plumule at p.
Indian Corn. Caulicle at b;
Hilum at h; micropyle at cotyledon at a;
d. plumule at p.

In studying corn or other


fruits or seeds, the pupil
should note how the seeds
are arranged, as on the
cob. Count the rows on a
corn cob. Odd or even in
number? Always the same
number? The silk is the
style: find where it was
attached to the kernel. Did
the ear have any
Fig. 27.—Indian Corn. coverings? Explain.
o, plumule; n to p, epicotyl. Describe colours and
markings of kernels of
corn; and of peas, beans, castor bean.
Gymnosperms.—The seeds in the pine cone, not being inclosed
in a seed vessel, readily fall out when the cone dries and the scales
separate. Hence it is difficult to find cones with seeds in them after
autumn has passed (Fig. 29). The cedar is also a gymnosperm.
Remove a scale from a pine cone and draw it and the seeds as
they lie in place on the upper side of the scale. Examine the seed,
preferably with a magnifying glass. Is
there a hilum? The micropyle is at the
bottom or little end of the seed. Toss a
seed upward into the air. Why does it fall
so slowly? Can you explain the peculiar
whirling motion by the shape of the
wing? Repeat the experiment in the
wind. Remove the wing from a seed and
toss it and an uninjured seed into the air
together. What do you infer from these
experiments?
Suggestions.—Few subjects connected with
the study of plant-life are so useful in schoolroom
demonstrations as germination. The pupil should
prepare the soil, plant the seeds, water them, and
care for the plants. 10. Plant seeds in pots or
shallow boxes. The box should not be very wide
or long, and not over four inches deep. Holes
may be bored in the bottom so it will not hold
water. Plant a number of squash, bean, corn,
pine, or other seeds about an inch deep in damp
sand or pine sawdust in this box. The depth of
planting should be two to four times the diameter
of the seeds. Keep the sand or sawdust moist but
not wet. If the class is large, use several boxes,
Fig. 28.—Germination is that the supply of specimens may be ample.
Complete. Cigar boxes and chalk boxes are excellent for
p, top of epicotyl; o, plumule-leaf; m, roots; individual pupils. It is well to begin the planting of
c, lower roots.
seeds at least ten days in advance of the lesson,
and to make four or five different plantings at
intervals. A day or two before the study is taken up, put seeds to soak in moss or
cloth. The pupil then has a series from swollen seeds to complete germination,
and all the steps can be made out. Dry seeds should be had for comparison. If
there is no special room for laboratory, nor duplicate apparatus for every pupil,
each experiment may be assigned to a committee of two pupils to watch in the
schoolroom. 11. Good seeds for study are those detailed in the lesson, and
buckwheat, pumpkin, cotton, morning glory, radish, four o’clock, oats, wheat. It is
best to use familiar seeds of farm and garden. Make drawings and notes of all the
events in the germination. Note the effects of unusual conditions, as planting too
deep and too shallow and different sides up. For hypogeal germination, use the
garden pea, scarlet runner, or Dutch case-knife bean,
acorn, horse-chestnut. Squash seeds are excellent for
germination studies, because the cotyledons become
green and leafy and germination is rapid. Onion is
excellent, except that it germinates too slowly. In order to
study the root development of germinating plantlets, it is
well to provide a deeper box with a glass side against
which the seeds are planted. 12. Observe the germination
of any common seed about the house premises. When
elms, oaks, pines, or maples are abundant, the
germination of their seeds may be studied in lawns and
along fences. 13. When studying germination the pupil
should note the differences in shape and size between
cotyledons and plumule leaves, and between plumule
leaves and the normal leaves (Fig. 30). Make drawings.
14.
Make
the
tests
describ
ed in
the
introduc
tory
experim
Fig. 30.—Muskmelon Seedlings, with the ents
unlike seed-leaves and true leaves. with
bean, Fig. 29.—Cones of
corn, the castor bean, and other seed for starch and Hemlock (above),
proteids. Test flour, oatmeal, rice, sunflower, four o’clock, White Pine, Pitch
various nuts, and any other seeds obtainable. Record Pine.
your results by arranging the seeds in three classes, 1.
Much starch (colour blackish or purple), 2. Little starch
(pale blue or greenish), 3. No starch (brown or yellow). 15. Rate of growth of
seedlings as affected by differences in temperature. Pack soft wet paper to the
depth of an inch in the bottom of four glass bottles or tumblers. Put ten soaked
peas or beans into each. Cover each securely and set them in places having
different temperatures that vary little. (A furnace room, a room with a stove, a room
without stove but reached by sunshine, an unheated room not reached by the
sun). Take the temperatures occasionally with the thermometer to find difference in
temperature. The tumblers in warm places should be covered very tightly to
prevent the germination from being retarded by drying out. Record the number of
seeds which sprout in each tumbler within 1 day, 2 days, 3 days, 4 days, etc. 16. Is
air necessary for the germination and growth of seedlings? Place damp blotting
paper in the bottom of a bottle and fill it three-fourths full of soaked seeds, and
close it tightly with a rubber stopper or oiled cork. Prepare a “check experiment” by
having another bottle with all conditions the same except that it is covered loosely
that air may have access to it, and set the bottles side by side (why keep the
bottles together?). Record results as in the preceding experiment. 17. What is the
nature of the gas given off by germinating seeds? Fill a tin box or large-necked
bottle with dry beans or peas, then add water; note how much they swell. Secure
two fruit jars. Fill one of them a third full of beans and keep them moist. Allow the
other to remain empty. In a day or two insert a lighted splinter or taper into each. In
the empty jar the taper burns: it contains oxygen. In the seed jar the taper goes
out: the air has been replaced by carbon dioxide. The air in the bottle may be
tested for carbon dioxide by removing some of it with a rubber bulb attached to a
glass tube (or a fountain-pen filler) and bubbling it through lime water. 18.
Temperature. Usually there is a perceptible rise in temperature in a mass of
germinating seeds. This rise may be tested with a thermometer. 19. Interior of
seeds. Soak seeds for twenty-four hours and remove the coat. Distinguish the
embryo from the endosperm. Test with iodine. 20. Of what utility is the food in
seeds? Soak some grains of corn overnight and remove the endosperm, being
careful not to injure the fleshy cotyledon. Plant the incomplete and also some
complete grains in moist sawdust and measure their growth at intervals. (Boiling
the sawdust will destroy moulds and bacteria which might interfere with the
experiment.) Peas or beans may be sprouted on damp blotting paper; the
cotyledons of one may be removed, and this with a normal seed equally advanced
in germination may be placed on a perforated cork floating in water in a jar so that
the roots extend into the water. Their growth may be observed for several weeks.
21. Effect of darkness on seeds and seedlings. A box may be placed mouth
downward over a smaller box in which seedlings are growing. The empty box
should rest on half-inch blocks to allow air to reach the seedlings. Note any effects
on the seedlings of this cutting off of the light. Another box of seedlings not so
covered may be used as a check. Lay a plank on green grass and after a week
note the change that takes place beneath it. 22. Seedling of pine. Plant pine
seeds. Notice how they emerge. Do the cotyledons stay in the ground? How many
cotyledons have they? When do the cotyledons get free from the seed-coat? What
is the last part of the cotyledon to become free? Where is the growing point or
plumule? How many leaves appear at once? Does the new pine cone grow on old
wood or on wood formed the same spring with the cone? Can you always find
partly grown cones on pine trees in winter? Are pine cones when mature on two-
year-old wood? How long do cones stay on a tree after the seeds have fallen out?
What is the advantage of the seeds falling before the cones? 23. Home
experiments. If desired, nearly all of the fore-going experiments may be tried at
home. The pupil can thus make the drawings for the notebook at home. A daily
record of measurements of the change in size of the various parts of the seedling
should also be made.
24. Seed-testing.—It is important that one know before
planting whether seeds are good, or able to grow. A
simple seed-tester may be made of two plates, one
inverted over the other (Fig. 31). The lower plate is nearly
filled with clean sand, which is covered with cheese cloth
or blotting paper on which the seeds are placed. Canton
flannel is sometimes used in place of sand and blotting
paper. The seeds are then covered with another blotter or
piece of cloth, and water is applied until the sand and
Fig. 31.—A Home-made papers are saturated. Cover with the second plate. Set
Seed-tester. the plates where they will have about the temperature
that the given seeds would require out of doors, or
perhaps a slightly higher temperature. Place 100 or more grains of clover, corn,
wheat, oats, rye, rice, buckwheat, or other seeds in the tester, and keep record of
the number that sprout. The result will give a percentage measure of the ability of
the seeds to grow. Note whether all the seeds sprout with equal vigour and
rapidity. Most seeds will sprout in a week or less. Usually such a tester must have
fresh sand and paper after each test, for mould fungi are likely to breed in it. If
canton flannel is used, it may be boiled. If possible, the seeds should not touch
one another.
Note to Teacher.—With the study of germination, the pupil will need to begin
dissecting.
For dissecting, one needs a lens for the examination of the smaller parts of
plants and animals. It is best to have the lens mounted on a frame, so that the
pupil has both hands free for pulling the part in pieces. An ordinary pocket lens
may be mounted on a wire in a block as in Fig. A. A cork is slipped on the top of
the wire to avoid injury to the face. The pupil should be provided with two
dissecting needles (Fig. B), made by securing an ordinary needle in a pencil-like
stick. Another convenient arrangement is shown in Fig. C. A small tin dish is used
for the base. Into this a stiff wire standard is soldered. The dish is filled with solder
to make it heavy and firm. Into a cork slipped on the standard, a cross wire is
inserted, holding on the end a jeweller’s glass. The lens can be moved up and
down and sidewise. This outfit can be made for about seventy-five cents. Fig. D
shows a convenient hand-rest or dissecting-stand to be used under this lens. It
may be 16 in. long, 4 in. high, and 4 or 5 in. broad.
Various kinds of dissecting microscopes are on the market, and these are to be
recommended when they can be afforded.
B.—Dissecting C.—Dissecting Glass. D.—Dissecting
Needle Stand.
½ natural size. A.—Improvised
Stand for Lens.

Instructions for the use of the compound microscope, with which


some schools may be equipped, cannot be given in a brief space;
the technique requires careful training. Such microscopes are not
needed unless the pupil studies cells and tissues.
CHAPTER VII
THE ROOT—THE FORMS OF ROOTS

The Root System.—The offices of the root are to hold the plant in
place, and to gather food. Not all the food materials, however, are
gathered by the roots.

Fig. 32.—Tap-
root System of Fig. 33.—Tap-root of the Dandelion.
Alfalfa.

The entire mass of roots of any plant is called its root system.
The root system may be annual, biennial or perennial, herbaceous or
woody, deep or shallow, large or small.
Kinds of Roots.—A strong leading central root, which runs
directly downwards, is a tap-root. The tap-root forms an axis from
which the side roots may branch. The side or spreading roots are
usually smaller. Plants that have such a root system are said to be
tap-rooted. Examples are red clover, alfalfa, beet, turnip, radish,
burdock, dandelion, hickory (Figs. 32, 33).
A fibrous root system is one that is composed of many nearly
equal slender branches. The greater number of plants have fibrous
roots. Examples are many common grasses, wheat, oats, corn. The
buttercup in Fig. 34 has a fibrous root system. Many trees have a
strong tap-root when very young, but after a while it ceases to
extend strongly and the side roots develop until finally the tap-root
character disappears.
Shape and Extent of the Root System.—
The depth to which roots extend depends on
the kind of plant, and the nature of the soil. Of
most plants the roots extend far in all directions
and lie comparatively near the surface. The
roots usually radiate from a common point just
beneath the surface of the ground.
The roots grow here and there in search of
food, often extending much farther in all
directions than the spread of the top of the
plant. Roots tend to spread farther in poor soil
than in rich soil, for the same size of plant. The
root has no such definite form as the stem has.
Roots are usually very crooked, because they
are constantly turned aside by obstacles.
Examine roots in stony soil.
Fig. 34.—A Buttercup
The extent of root surface is usually very Plant, with fibrous
large, for the feeding roots are fine and very roots.
numerous. An ordinary plant of Indian corn may
have a total length of root (measured as if the roots were placed end
to end) of several hundred feet.
The fine feeding roots are most abundant in the richest part of the
soil. They are attracted by the food materials. Roots often will
completely surround a bone or other morsel. When roots of trees are
exposed, observe that most of them are horizontal and lie near the
top of the ground. Some roots, as of willows, extend far in search of
water. They often run into wells and drains, and into the margins of
creeks and ponds. Grow plants in a long narrow box, in one end of
which the soil is kept very dry and in the other moist: observe where
the roots grow.
Buttresses.—With the increase
in diameter, the upper roots often
protrude above the ground and
become bracing buttresses.
These buttresses are usually
largest in trees which always have
been exposed to strong winds
(Fig. 35). Because of growth and
thickening, the roots elevate part
of their diameter, and the washing
Fig. 35.—The Bracing Base of a Field away of the soil makes them to
Pine.
appear as if having risen out of
the ground.
Aërial Roots.—Although roots usually grow underground, there
are some that naturally grow above ground. These usually occur on
climbing plants, the roots becoming supports or fulfilling the office of
tendrils. These aërial roots usually turn away from the light, and
therefore enter the crevices and dark places of the wall or tree over
which the plant climbs. The trumpet creeper (Fig. 36), true or English
ivy, and poison ivy climb by means of roots.
In some plants all the roots are aërial; that is, the plant grows
above ground, and the roots gather food from the air. Such plants
usually grow on trees. They are known as epiphytes or air-plants.
The most familiar examples are some of the tropical orchids which
are grown in glass-houses (Fig. 37). Rootlike organs of dodder and
other
parasit
es are
discus
sed in
a
future
chapte
r.
So
me
plants
bear
aërial
roots,
that
may
propa
gate
the Fig. 37.—Aërial Roots of an Orchid.
plant
or
may act as braces. They are often called
prop-roots. The roots of Indian corn are
familiar (Fig. 38). Many ficus trees, as the
banyan of India, send out roots from their
branches; when these roots reach the
ground they take hold and become great
trunks, thus spreading the top of the parent
tree over large areas. The mangrove tree of
the tropics grows along seashores and
sends down roots from the overhanging
branches (and from the fruits) into the
Fig. 36.—Aërial Roots of shallow water, and thereby gradually
Trumpet Creeper or
Tecoma. marches into the sea. The tangled mass
behind catches the drift, and soil is formed.
Adventitious Roots.—Sometimes roots grow
from the stem or other unusual places as the result
of some accident to the plant, being located without
known method or law. They are called
adventitious (chance) roots. Cuttings of the stems
of roses, figs, geraniums, and other plants, when
planted, send out adventitious roots and form new
plants. The ordinary roots, or soil roots, are of
course not classed as adventitious roots. The
adventitious roots arise on occasion, and not as a
normal or regular course in the growth of the plant.
No two roots are alike; that is, they vary among
themselves as stems and leaves do. Each kind of
plant has its own form or habit of root (Fig. 39).
Carefully wash away the soil from the roots of any
Fig. 38.—Indian
two related plants, as oats and wheat, and note the
Corn, showing
the brace roots at differences in size, depth, direction, mode of
oo. branching, number of fibrils, colour, and other
features. The character of the root system often
governs the treatment that the farmer should give the soil in which
the plant or crop grows.
Fig. 39.—Roots of Barley at A and Corn at B.
Carefully trace the differences.

Roots differ not only in their form and habit, but also in colour of
tissue, character of bark or rind, and other features. It is excellent
practice to try to identify different plants by means of their roots. Let
each pupil bring to school two plants with the roots very carefully dug
up, as cotton, corn, potato, bean, wheat, rye, timothy, pumpkin,
clover, sweet pea, raspberry, strawberry, or other common plants.
Root Systems of Weeds.—Some weeds are pestiferous because
they seed abundantly, and others because their underground parts
run deep or far and are persistent. Make out the root systems in the
six worst weeds in your locality.
CHAPTER VIII
THE ROOT.—FUNCTION AND STRUCTURE

The function of roots is twofold,—to provide support or


anchorage for the plant, and to collect and convey food materials.
The first function is considered in Chapter VII; we may now give
attention in more detail to the second.
The feeding surface of the roots is near
their ends. As the roots become old and
hard, they serve only as channels through
which food passes and as hold-fasts or
supports for the plant. The root hold of a
plant is very strong. Slowly pull upwards on
some plant, and note how firmly it is
anchored in the soil.
Roots have power to choose their food;
that is, they do not absorb all substances
with which they come in contact. They do
not take up great quantities of useless or
harmful materials, even though these
materials may be abundant in the soil; but
Fig. 40.—Wheat growing they may take up a greater quantity of some
under Different Soil of the plant-foods than the plant can use to
Treatments. Soil advantage. Plants respond very quickly to
deficient in nitrogen;
commercial nitrogen liberal feeding,—that is, to the application of
applied to pot 3 (on right). plant-food to the soil (Fig 40). The poorer the
soil, the more marked are the results, as a
rule, of the application of fertilizers. Certain
substances, as common salt, will kill the roots.
Roots absorb Substances only in Solution.—Substances
cannot be taken in solid particles. These materials are in solution in
the soil water, and the roots themselves
also have the power to dissolve the soil
materials to some extent by means of
substances that they excrete. The
materials that come into the plant
through the roots are water and mostly
the mineral substances, as compounds
of potassium, iron, phosphorus, calcium,
magnesium, sulphur, and chlorine. These
mineral substances compose the ash
when the plant is burned. The carbon is
derived from the air through the green
parts. Oxygen is derived from the air and
the soil water.
Nitrogen
enters
through the
Roots.—All
plants must
have Fig. 41.—Nodules on Roots
nitrogen; yet, of Red Clover.
although
about four-fifths of the air is nitrogen,
plants are not able, so far as we know, to
take it in through their leaves. It enters
through the roots in combination with
other elements, chiefly in the form of
nitrates (certain combinations with
Fig. 42.—Nodules on Vetch.
oxygen and a mineral base). The great
family of leguminous plants, however (as
peas, beans, cowpea, clover, alfalfa, vetch), use the nitrogen
contained in the air in the soil. They are able to utilize it through the
agency of nodules on their roots (Figs. 41, 42). These nodules
contain bacteria, which appropriate the free or uncombined nitrogen
and pass it on to the plant. The nitrogen becomes incorporated in the
plant tissue, so that these crops are high in their nitrogen content.
Inasmuch as nitrogen in any form is expensive to purchase in
fertilizers, the use of leguminous crops to plough under is a very
important agricultural practice in preparing the land for other crops.
In order that leguminous crops may acquire atmospheric nitrogen
more freely and thereby thrive better, the land is sometimes sown or
inoculated with the nodule-forming bacteria.
Roots require moisture in
order to serve the plant. The soil
water that is valuable to the plant
is not the free water, but the thin
film of moisture which adheres to
each little particle of soil. The finer
the soil, the greater the number of
particles, and therefore the
greater is the quantity of film
moisture that it can hold. This
moisture surrounding the grains
may not be perceptible, yet the
plant can use it. Root absorptionFig. 43.—Two Kinds of Soil that have
may continue in a soil which been Wet and then Dried. The
seems to be dust dry. Soils that loamy soil above remains loose and
are very hard and “baked” (Fig. capable of growing plants; the clay soil
below has baked and cracked.
43) contain very little moisture or
air,—not so much as similar soils
that are granular or mellow.
Proper Temperature for Root Action.—The root must be warm
in order to perform its functions. Should the soil of fields or
greenhouses be much colder than the air, the plant suffers. When in
a warm atmosphere, or in a dry atmosphere, plants need to absorb
much water from the soil, and the roots must be warm if the root-
hairs are to supply the water as rapidly as it is needed. If the roots
are chilled, the plant may wilt or die.
Roots need Air.—Corn on land that has been flooded
by heavy rains loses its green colour and turns yellow.
Besides diluting plant-food, the water drives the air from
the soil, and this suffocation of the roots is very soon
apparent in the general ill health of the plant. Stirring or
tilling the soil aërates it. Water plants and bog plants have
adapted themselves to their particular conditions. They get
their air either by special surface roots, or from the water
through stems and leaves.
Rootlets.—Roots divide into the thinnest and finest
fibrils: there are roots and there are rootlets. The smallest
rootlets are so slender and delicate that they break offFig. 44.—
even when the plant is very carefully lifted from the soil. Root-
hairs of
The rootlets, or fine divisions, are clothed with the root- the
hairs (Figs. 44, 45, 46). These root-hairs attach to the soil Radish.
particles, and a great amount of soil is thus brought into
actual contact with the plant. These are very delicate prolonged
surface cells of the roots. They are borne for a short distance just
back of the tip of the root.
Rootlet and root-hair differ. The rootlet is a compact cellular
structure. The root-hair is a delicate tubular cell (Fig. 45), within
which is contained living matter (protoplasm); and the protoplasmic
lining membrane of the wall governs the entrance of water and
substances in solution. Being long and tube-like, these root-hairs are
especially adapted for taking in the largest quantity of solutions; and
they are the principal means by which plant-food is absorbed from
the soil, although the surfaces of the rootlets themselves do their
part. Water plants do not produce an abundant system of root-hairs,
and such plants depend largely on their rootlets.
The root-hairs are very small, often invisible. They, with the young
roots, are usually broken off when the plant is pulled up. They are
best seen when seeds are germinated between layers of dark
blotting paper or flannel. On the young roots they will be seen as a
mould-like or gossamer-like covering. Root-hairs soon die: they do
not grow into
roots. New
ones form as
the root
grows.
Osmosis.
—The water
with its
nourishment Fig. 46.—Root-hair, much
goes through enlarged, in contact with
the thin walls the soil particles (s). Air-
of the root- spaces at a; water-films
hairs and on the particles, as at w.
Fig. 45.—Cross-section of Root,
rootlets by
enlarged, showing root-hairs. the process of osmosis. If there are
two liquids of different density on the
inside and outside of an organic
(either vegetable or animal) membrane, the liquids tend to mix
through the membrane. The law of osmosis is that the most rapid
flow is toward the denser solution. The protoplasmic lining of the cell
wall is such a membrane. The soil water being a weaker solution
than the sap in the roots, the flow is into the root. A strong fertilizer
sometimes causes a plant to wither, or “burns it.” Explain.
Structure of Roots.—The root that grows from the lower end of
the caulicle is the first or primary root. Secondary roots branch
from the primary root. Branches of secondary roots are sometimes
called tertiary roots. Do the secondary roots grow from the cortex,
or from the central cylinder of the primary root? Trim or peel the
cortex from a root and its branches and determine whether the
branches still hold to the central cylinder of the main root.
Internal Structure of Roots.—A section of a root shows that it
consists of a central cylinder (see Fig. 45) surrounded by a layer.
This layer is called the cortex. The outer layer of cells in the cortex
is called the epidermis, and some of the cells of the epidermis are
prolonged and form the delicate root-hairs. The cortex resembles the
bark of the stem in its nature. The central cylinder contains many
tube-like canals, or “vessels” that convey water and food (Fig. 45).
Cut a sweet potato across (also a radish and a turnip) and
distinguish the central cylinder, cortex, and epidermis. Notice the
hard cap on the tip of roots. Roots differ from stems in having no real
pith.
Microscopic Structure of Roots.—Near
the end of any young root or shoot the cells
are found to differ from one another more or
less, according to the distance from the
point. This differentiation takes place in the
region just back of the growing point. To
study growing points, use the hypocotyl of
Indian corn which has grown about one-half
inch. Make a longitudinal section. Note these
points (Fig. 47): (a) the tapering root-cap
beyond the growing point; (b) the blunt end
of the root proper and the rectangular shape
of the cells found there; (c) the group of cells
in the middle of the first layers beneath the
root-cap,—this group is the growing point;
Fig. 47.—Growing Point
(d) study the slight differences in the tissues
of Root of Indian Corn.
d, d, cells which will form the a short distance back of the growing point.
epidermis; p, p, cells that will form
bark; e, e, endodermis; pl, cells
There are four regions: the central cylinder,
which will form the axis cylinder; i, made up of several rows of cells in the
initial group of cells, or growing
point proper; c, root-cap. centre (pl); the endodermis, (e) composed
of a single layer on each side which
separates the central cylinder from the bark; the cortex, or inner
bark, (e) of several layers outside the endodermis; and the
epidermis, or outer layer of bark on the outer edges (d). Make a
drawing of the section. If a series of the cross-sections of the
hypocotyl should be made and studied by the pupil beginning near
the growing point and going upward, it would be found that these
four tissues become more distinctly marked, for at the tip the tissues
have not yet assumed their characteristic form. The central cylinder
contains the ducts and vessels which convey the sap.
The Root-cap.—Note the form of the root-cap
shown in the microscopic section drawn in Fig. 47.
Growing cells, and especially those which are
forming tissue by subdividing, are very delicate and
are easily injured. The cells forming the root-cap
are older and tougher and are suited for pushing
aside the soil that the root may penetrate it.
Region of most Rapid Growth.—The roots of a
seedling bean may be marked at equal distances
by waterproof ink or by bits of black thread tied
moderately tight. The seedling is then replanted
and left undisturbed for two days. When it is dug Fig. 48.—The
up, the region of most rapid growth in the root can Marking of the
be determined. Give a reason why a root cannot Stem and Root.
elongate throughout its length,—whether there is
anything to prevent a young root from doing so.
In Fig. 48 is shown a germinating scarlet runner bean with a short
root upon which are marks made with waterproof ink; and the same
root (Fig. 49) is shown after it has grown longer. Which part of it did
not lengthen at all? Which part lengthened slightly? Where is the
region of most rapid growth?
Geotropism.—Roots turn toward the earth, even if the seed is
planted with the micropyle up. This phenomenon is called positive
geotropism. Stems grow away from the earth. This is negative
geotropism.
Suggestions (Chaps. VII and VIII).—25. Tests for food. Examine a number of
roots, including several fleshy roots, for the presence of food material, making the
tests used on seeds. 26. Study of root-hairs. Carefully germinate radish, turnip,
cabbage, or other seed, so that no delicate parts of the root will be injured. For this
purpose, place a few seeds in packing-moss or in the folds of thick cloth or of
blotting paper, being careful to keep them moist and warm. In a few days the seed
has germinated, and the root has grown an inch or two long. Notice that, except at
a distance of about a quarter of an inch behind the tip, the root is covered with
minute hairs (Fig. 44). They are actually hairs;
that is, root-hairs. Touch them and they collapse,
they are so delicate. Dip one of the plants in
water, and when removed the hairs are not to be
seen. The water mats them together along the
root and they are no longer evident. Root-hairs
are usually destroyed when a plant is pulled out
of the soil, be it done ever so carefully. They cling
to the minute particles of soil (Fig. 46). The hairs
show best against a dark background. 27. On
some of the blotting papers, sprinkle sand;
observe how the root-hairs cling to the grains.
Observe how they are flattened when they come
in contact with grains of sand.
28. Root hold of plant. The pupil should also
study the root hold. Let him carefully pull up a
plant. If a plant grows alongside a fence or other
rigid object, he may test the root hold by securing
a string to the plant, letting the string hang over
the fence, and then adding weights to the string.
Will a stake of similar size to the plant and
extending no deeper in the ground have such
firm hold on the soil? What holds the ball of earth
in Fig. 50? 29. Roots exert pressure. Place a
strong bulb of hyacinth or daffodil on firm-packed
earth in a pot; cover the bulb nearly to the top
with loose earth; place in a cool cellar; after some
days or weeks, note that the bulb has been
raised out of the earth by the forming roots. All
Fig. 49.—The Result. roots exert pressure on the soil as they grow.
Explain.
30. Response of roots and stems to the force of gravity, or geotropism. Plant a
fast-growing seedling in a pot so that the plumule extends through the drain hole
and suspend the pot with mouth up (i.e. in the usual position). Or use a pot in
which a plant is already growing, cover with cloth or wire gauze to prevent the soil
from falling, and suspend the pot in an inverted position (Fig. 51). Notice the
behaviour of the stem, and after a few days remove the soil and observe the
position of the root. 31. If a pot is laid on one side, and changed every two days
and laid on its opposite side, the effect on the root and stem will be interesting. 32.
If a fleshy root is planted wrong end up, what is the result? Try it with pieces of
horse-radish root. 33. By planting radishes on a slowly revolving wheel the effect
of gravity may be neutralized. 34. Region of root most sensitive to gravity. Lay on
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookluna.com

You might also like