Book contents
- Frontmatter
- Contents
- Preface
- Python for Software Design
- 1 The Way of the Program
- 2 Variables, Expressions, and Statements
- 3 Functions
- 4 Case Study: Interface Design
- 5 Conditionals and Recursion
- 6 Fruitful Functions
- 7 Iteration
- 8 Strings
- 9 Case Study: Word Play
- 10 Lists
- 11 Dictionaries
- 12 Tuples
- 13 Case Study: Data Structure Selection
- 14 Files
- 15 Classes and Objects
- 16 Classes and Functions
- 17 Classes and Methods
- 18 Inheritance
- 19 Case Study: Tkinter
- Appendix
- Index
1 - The Way of the Program
Published online by Cambridge University Press: 05 June 2012
- Frontmatter
- Contents
- Preface
- Python for Software Design
- 1 The Way of the Program
- 2 Variables, Expressions, and Statements
- 3 Functions
- 4 Case Study: Interface Design
- 5 Conditionals and Recursion
- 6 Fruitful Functions
- 7 Iteration
- 8 Strings
- 9 Case Study: Word Play
- 10 Lists
- 11 Dictionaries
- 12 Tuples
- 13 Case Study: Data Structure Selection
- 14 Files
- 15 Classes and Objects
- 16 Classes and Functions
- 17 Classes and Methods
- 18 Inheritance
- 19 Case Study: Tkinter
- Appendix
- Index
Summary
The goal of this book is to teach you to think like a computer scientist. This way of thinking combines some of the best features of mathematics, engineering, and natural science. Like mathematicians, computer scientists use formal languages to denote ideas (specifically computations). Like engineers, they design things, assembling components into systems and evaluating tradeoffs among alternatives. Like scientists, they observe the behavior of complex systems, form hypotheses, and test predictions.
The single most important skill for a computer scientist is problem solving. Problem solving means the ability to formulate problems, think creatively about solutions, and express a solution clearly and accurately. As it turns out, the process of learning to program is an excellent opportunity to practice problem-solving skills. That's why this chapter is called “The way of the program.”
On one level, you will be learning to program, a useful skill by itself. On another level, you will use programming as a means to an end. As we go along, that end will become clearer.
THE PYTHON PROGRAMMING LANGUAGE
The programming language you will learn is Python. Python is an example of a high-level language; other high-level languages you might have heard of are C, C++, Perl, and Java.
There are also low-level languages, sometimes referred to as “machine languages” or “assembly languages.” Loosely speaking, computers can only execute programs written in low-level languages.
- Type
- Chapter
- Information
- Python for Software DesignHow to Think Like a Computer Scientist, pp. 1 - 9Publisher: Cambridge University PressPrint publication year: 2009