SKIP THE SHIPPING
Use code NOSHIP during checkout to save 40% on eligible eBooks, now through January 5. Shop now.
Publishers of technology books, eBooks, and videos for creative people
Register your product to gain access to bonus material or receive a coupon.
This eBook includes the following formats, accessible from your Account page after purchase:
EPUB The open industry format known for its reflowable content and usability on supported mobile devices.
PDF The popular standard, used most often with the free Acrobat® Reader® software.
This eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.
Python is a remarkably powerful dynamic programming language used in a wide variety of situations such as Web, database access, desktop GUIs, game and software development, and network programming. Fans of Python use the phrase "batteries included" to describe the standard library, which covers everything from asynchronous processing to zip files. The language itself is a flexible powerhouse that can handle practically any application domain.
This task-based tutorial on Python is for those new to the language and walks you through the fundamentals. You'll learn about arithmetic, strings, and variables; writing programs; flow of control, functions; strings; data structures; input and output; and exception handling. At the end of the book, a special section walks you through a longer, realistic application, tying the concepts of the book together.
Download Chapter 4 Flow of Control
Chapter 1 Introduction to Programming
Chapter 2 Arithmetic, Strings, and Variables
Chapter 3 Writing Programs
Chapter 4 Flow of Control
Chapter 5 Functions
Chapter 6 Strings
Chapter 7 Data Structures
Chapter 8 Input and Output
Chapter 9 Exception Handling
Chapter 10 Object-Oriented Programming
Chapter 11 Case Study: Text Statistics
Appendix A Popular Python Packages
Appendix B Comparing Python 2 and Python 3
Index
All page numbers refer to text version of 3rd edition.
Double back-quotes indicate code font, e.g. ``ValueError``.
Single *s represent italics, e.g. *raises*.
p.52
there is a missing single quote after child fare. It should be rewritten as follows:
print('child fare')
p.93
Paragraph beginning "The find function ..." mixes up find and index. It should
be re-written as follows:
The ``index`` function *raises* a ``ValueError``; this is an example of an
exception, which we will talk about in more detail in Chapter 9. The
``find`` function returns -1 if the string being searched for is not
found.
p. 141
Replace "html = resp.read()" with "html = page.read()"
p. 156
In the code inside the "print" function, replace "Person('%s', age)" with
"Person('%s', %s)".