Python
Kaup valmöguleikar
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.
Nánar um bókina
- Pearson Technology Group
- 9780133435153
- 9780321929556
- ePub
- 3
- Toby Donaldson
- English
- 2013-06-27
- 100
- 2
- 2
Kaflar
- Title Page
- Copyright Page
- Acknowledgments
- Contents at a Glance
- Table of Contents
- 1. Introduction to Programming
- The Python Language
- What Is Python Useful For?
- How Programmers Work
- Installing Python
- 2. Arithmetic, Strings, and Variables
- The Interactive Command Shell
- Integer Arithmetic
- Floating Point Arithmetic
- Other Math Functions
- Strings
- String Concatenation
- Getting Help
- Converting Between Types
- Variables and Values
- Assignment Statements
- How Variables Refer to Values
- Multiple Assignment
- 3. Writing Programs
- Using IDLE’s Editor
- Compiling Source Code
- Reading Strings from the Keyboard
- Printing Strings on the Screen
- Source Code Comments
- Structuring a Program
- 4. Flow of Control
- Boolean Logic
- If-Statements
- Code Blocks and Indentation
- Loops
- Comparing For-Loops and While-Loops
- Breaking Out of Loops and Blocks
- Loops Within Loops
- 5. Functions
- Calling Functions
- Defining Functions
- Variable Scope
- Using a main Function
- Function Parameters
- Modules
- 6. Strings
- String Indexing
- Characters
- Slicing Strings
- Standard String Functions
- Regular Expressions
- 7. Data Structures
- The type Command
- Sequences
- Tuples
- Lists
- List Functions
- Sorting Lists
- List Comprehensions
- Dictionaries
- Sets
- 8. Input and Output
- Formatting Strings
- String Formatting
- Reading and Writing Files
- Examining Files and Folders
- Processing Text Files
- Processing Binary Files
- Reading Webpages
- 9. Exception Handling
- Exceptions
- Catching Exceptions
- Clean-Up Actions
- 10. Object-Oriented Programming
- Writing a Class
- Displaying Objects
- Flexible Initialization
- Setters and Getters
- Inheritance
- Polymorphism
- Learning More
- 11. Case Study: Text Statistics
- Problem Description
- Keeping the Letters We Want
- Testing the Code on a Large Data File
- Finding the Most Frequent Words
- Converting a String to a Frequency Dictionary
- Putting It All Together
- Exercises
- The Final Program
- A. Popular Python Packages
- Some Popular Packages
- B. Comparing Python 2 and Python 3
- What’s New in Python 3
- Index