ISBN-10:
1849965366
ISBN-13:
9781849965361
Pub. Date:
10/28/2010
Publisher:
Springer London
Python Programming Fundamentals / Edition 1

Python Programming Fundamentals / Edition 1

by Kent D. Lee

Paperback

Current price is , Original price is $39.95. You

Temporarily Out of Stock Online

Please check back later for updated availability.

This item is available online through Marketplace sellers.

MARKETPLACE
2 New & Used Starting at $10.67

Overview

Undergraduate Topics in Computer Science (UTiCS) delivers high-quality instructional content for undergraduates studying in all areas of computing and information science. From core foundational and theoretical material to final-year topics and applications, UTiCS books take a fresh, concise, and modern approach and are ideal for self-study or for a one- or two-semester course. The texts are all authored by established experts in their fields, reviewed by an international advisory board, and contain numerous examples and problems. Many include fully worked solutions.

Computer programming is a skill that can bring great enjoyment from the creativity involved in designing and implementing a solution to a problem. This classroom-tested and easy-to-follow textbook teaches the reader how to program using Python, an accessible language which can be learned incrementally. Through an extensive use of examples and practical exercises, students will learn to recognize and apply abstract patterns in programming, as well as how to inspect the state of a program using a debugger tool.

Features:

Contains numerous examples and solved practice exercises designed for an interactive classroom environment

Highlights several patterns which commonly appear in programs, and presents exercises that reinforce recognition and application of these patterns

Introduces the use of a debugger, and includes supporting material that reveals how programs work

Presents the Tkinter framework for building graphical user interface applications and event-driven programs

Provides helpful additional resources for instructors at the associated website: cs.luther.edu/leekent/CS1

This hands on textbook for active learning in the classroom will enable undergraduates in computer science to develop the necessary skills to begin developing their own programs. It employs Python as the introductory language due to the wealth of support available for programmers.

Product Details

ISBN-13: 9781849965361
Publisher: Springer London
Publication date: 10/28/2010
Series: Undergraduate Topics in Computer Science Series
Edition description: 2011
Pages: 241
Product dimensions: 5.90(w) x 8.90(h) x 0.80(d)

About the Author

Dr. Kent D. Lee is Professor of Computer Science at Luther College, Decorah, Iowa, USA. He is the author of the forthcoming Springer textbooks Data Structures and Algorithms with Python and Foundations of Programming Languages.

Table of Contents

1 Introduction 1

1.1 The Python Programming Language 2

1.2 Installing Python and Wing IDE 101 3

1.3 Writing Your First Program 7

1.4 What is a Computer? 8

1.5 Binary Number Representation 10

1.6 What is a Programming Language? 13

1.7 Hexadecimal and Octal Representation 15

1.8 Writing Your Second Program 16

1.9 Syntax Errors 18

1.10 Types of Values 19

1.11 The Reference Type and Assignment Statements 20

1.12 Integers and Real Numbers 21

1.13 Strings 24

1.14 Integer to String Conversion and Back Again 25

1.15 Getting Input 26

1.16 Formatting Output 27

1.17 When Things Go Wrong 30

1.18 Review Questions 33

1.19 Exercises 34

1.20 Solutions to Practice Problems 36

2 Decision Making 41

2.1 Finding the Max of Three Integers 45

2.2 The Guess and Check Pattern 47

2.3 Choosing from a List of Alternatives 48

2.4 The Boolean Type 50

2.5 Short Circuit Logic 53

2.6 Comparing Floats for Equality 54

2.7 Exception Handling 55

2.8 Review Questions 57

2.9 Exercises 58

2.10 Solutions to Practice Problems 61

3 Repetitive Tasks 65

3.1 Operators 67

3.2 Iterating Over a Sequence 69

3.3 Lists 71

3.4 The Guess and Check Pattern for Lists 74

3.5 Mutability of Lists 75

3.6 The Accumulator Pattern 79

3.7 Reading from and Writing to a File 80

3.8 Reading Records from a File 82

3.9 Review Questions 85

3.10 Exercises 86

3.11 Solutions to Practice Problems 88

4 Using Objects 93

4.1 Constructors 96

4.2 Accessor Methods 98

4.3 Mutator Methods 98

4.4 Immutable Classes 99

4.5 Object-Oriented Programming 100

4.6 Working with XML Files 100

4.7 Extracting Elements from an XML File 103

4.8 Dictionaries 104

4.9 Getting at the Data in an XML File 105

4.10 Working with Time 107

4.11 Parallel Lists 107

4.12 Visualizing a Workout 108

4.13 Review Questions 110

4.14 Exercises 110

4.15 Solutions to Practice Problems 113

5 Defining Functions 119

5.1 Why Write Functions? 120

5.2 Passing Arguments and Returning a Value 121

5.3 Scope of Variables 122

5.4 The Run-time Stack 126

5.5 Mutable Data and Functions 129

5.6 Predicate Functions 131

5.7 Top-Down Design 133

5.8 Bottom-Up Design 134

5.9 Recursive Functions 134

5.10 The Main Function 136

5.11 Keyword Arguments 139

5.12 Default Values 140

5.13 Functions with Variable Number of Parameters 140

5.14 Dictionary Parameter Passing 141

5.15 Review Questions 142

5.16 Exercises 142

5.17 Solutions to Practice Problems 145

6 Event-Driven Programming 149

6.1 The Root Window 150

6.2 Menus 151

6.3 Frames 152

6.4 The Text Widget 152

6.5 The Button Widget 153

6.6 Creating a Reminder! 154

6.7 Finishing up the Reminder! Application 156

6.8 Label and Entry Widgets 157

6.9 Layout Management 158

6.10 Message Boxes 159

6.11 Review Questions 160

6.12 Exercises 161

6.13 Solutions to Practice Problems 164

7 Defining Classes 167

7.1 Creating an Object 168

7.2 Inheritance 172

7.3 A Bouncing Ball Example 178

7.4 Polymorphism 180

7.5 Getting Hooked on Python 181

7.6 Review Questions 184

7.7 Exercises 184

7.8 Solutions to Practice Problems 190

Appendix A Integer Operators 193

Appendix B Float Operators 195

Appendix C String Operators and Methods 197

Appendix D List Operators and Methods 201

Appendix E Dictionary Operators and Methods 203

Appendix F Turtle Methods 205

Appendix G TurtleScreen Methods 217

Appendix H The Reminder! Program 225

Appendix I The Bouncing Ball Program 227

Glossary 231

References 237

Index 239

Customer Reviews

Most Helpful Customer Reviews

See All Customer Reviews