Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Matt Telles

Rating No ratings yet

Learn to be a Python expert in ten easy lessons! Key Features Acquire knowledge of Python programming simply and easily. Learn about object-oriented programming and how it applies to Python. Make a splash with list comprehensions, generators, and decorators. Learn about file processing with Python, and how it makes JSON easy to deal with. Work with dictionaries and sets quickly and easily. Learn about what others have made available in the Python world. Pick up tricks and tips that will make you look like a Python expert in no time. Description This book is intended for the professional programmer who wants to learn Python for their place of business, or simply to extend their knowledge. You will learn the basics of the language--from how to define variables and implement looping and conditional constructs, to working with existing code. Once we have established the baseline for writing code in Python, you’ll learn how to create your own functions and classes, how to extend existing code, and how to work with Python-specific things like comprehensions and generators. With a solid foundation, you will then move on to learn about the existing Python libraries, called packages, and how to use them, as well as discovering little tips and tricks that will make you a hit with all the programmers at work, and really aid you in nailing that programming interview. What will you learn By the time you have finished this book, you will know enough to write complex Python programs and work with existing Python code. You will find out about the packages that make Python one of the most popular programming languages and will understand the “Pythonic” way of thinking and programming. Who this book is for This book is designed for programmers who have experience in at least one programming language. No prior Python experience is necessary, but it is assumed that you understand the basics of loops, conditionals and object-oriented constructs, such as classes. You should have or have

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A fast, example-driven bridge from "I know how to program" to "I write Python the way Python people write it." Best for working developers in Java, C#, or C++ who need to read and ship production Python without wading through a beginner's tour of what a variable is. 【Book Arc】 - **Opening (~0%–10%)**: Frames the book's premise — Python 3.x for experienced programmers — and previews the ten-lesson structure, from language history and installation/venv setup through files, imports, and a grab-bag of advanced topics. - **Early (~10%–30%)**: Establishes the Pythonic mindset (the Zen, simplicity and readability over cleverness) and the core type system: numbers and operator precedence, strings and slicing, lists, tuples, dictionaries, sets, and the shared collection idioms that tie them together. - **Early–Middle (~30%–45%)**: Moves into control flow and the mechanics that trip up newcomers from brace-and-semicolon languages — indentation as syntax, `pass`, loop `else`, and comparison semantics. - **Middle (~45%–60%)**: Functions and object-oriented Python: defining and extending classes, inheritance and multiple inheritance, polymorphism, operator and method overloading, read-only attributes, `__new__`, and making classes iterable. - **Late (~60%–85%)**: The "advanced manipulations" layer that makes code concise and idiomatic — list/dictionary/set comprehensions, generators, lambda expressions, the splat/unpacking operator, slicing, searching, and filtering versus removing. - **Ending (~85%–100%)**: Practical breadth: text and binary file processing, JSON handling, imports and exports (using others' code and packaging your own), plus decorators, properties, documentation, and metaclasses. 【Key Takeaways】 - **Pythonic means simple and readable, not clever** (Early): the book anchors its whole teaching style in the Zen's "one obvious way" — expect to unlearn habits that favor dense one-liners over legible code. - **Collections share a common protocol** (Early): lists, tuples, dicts, and sets differ mainly in mutability and shape, so learning the shared operations (iteration, membership, `any()`, sorting with a `key`) pays off across all of them. - **Mutability is the real dividing line** (Early): tuples behave like lists except they can't be modified; `remove()` deletes by value and only the first match, `del` deletes by index, and dict `pop()` returns what it removes — small distinctions with real bug potential. - **Indentation is structure, not style** (Middle): nested blocks, loop `else`, and `pass` as a deliberate no-op are the constructs most likely to confuse programmers arriving from C-family languages. - **Comprehensions and generators are the productivity core** (Late): list, dictionary, set, and nested dictionary comprehensions, plus generators, are presented as the idiomatic replacement for manual accumulation loops. - **Sorting and searching get flexible via callables** (Middle–Late): `sorted()` with a `key` function (later a lambda) is the pattern for multi-field, real-world ordering that goes beyond textbook examples. - **Classes go deeper than `class` and `__init__`** (Middle): inheritance, multiple inheritance, operator overloading, `__new__`, and iterable classes are covered as the machinery behind extensible, reusable code. - **The ecosystem is part of the language** (Ending): imports, packaging your own code, file/JSON processing, and decorators/properties/metaclasses are what let you work with existing Python codebases rather than only greenfield scripts. 【Reading Tips】 - **Skim the early type chapters if you're fluent in another language** — read the string/list/dict sections for Python-specific quirks (negative indexing, slicing with step, `remove` vs `del`) rather than for general concepts. - **Deep-read the middle and late sections**: indentation semantics, comprehension/generator syntax, and class mechanics are where prior-language intuition actively misleads you. - **Type every example**: the excerpts are built around interactive interpreter sessions and small snippets, and the value is in the immediate feedback, not the prose. - **Treat the final chapters as a map, not a manual**: file/JSON handling, imports, decorators, and metaclasses are broad topics; note what exists and return when a real task demands it. - **Keep the Zen in mind as a review checklist**: before shipping code, ask whether it's simple, readable, and explainable in one comment. 【Coverage Limits】 This guide is synthesized from stratified excerpts (front matter, table of contents, and sampled sections); specific chapter numbering, later-chapter depth, and any exercises or question sets are only partially visible, so claims about the book's final chapters are inferred from headings and previews rather than full text.
Excerpt 1
rs who have experience in at least one programming language. No prior Python experience is necessary, but it is assumed that you understand the basics of loo...
View in text
Excerpt 2
might write something like this to use the streams library: Integer sum = list.stream().map(Employee::getSalary) .reduce(0, (Integer a, Integer b) -> Integer...
View in text
Excerpt 3
'd need to iterate over the dictionary and find all of the keys that had that value and then remove them one at a time. It is a BAD IDEA to delete items in a...
View in text
Excerpt 4
range(0,10): if i % 2 != 0: print("{0} is odd".format(i)) Without the indentation, the Python interpreter has no way of knowing that the print statement is c...
View in text
Excerpt 5
: >>> import test3 This is a new file Hello world >>> test3.my_function("This is a test") his is a test Notice that we have to prefix the function name with...
View in text
Excerpt 6
est.__init__(self) self.b_variable = self.a_variable * 2 def printme(self): print(self.b_variable) dit2 = DerivedInternalTest2() dit2.printme() 40 Let’s chec...
View in text
Excerpt 7
appear to do anything. However, that’s not the case. Try running this bit of code: print(at.__doc__) You should see the following display on your Python cons...
View in text
Excerpt 8
ver and passing in a new string formed by the substring of the original incremented past the position of the substring, to using self-built string searching...
View in text
Tags
AI categories
PythonProgramming LanguageSoftware
ISBN: 9389423759
Publisher: BPB Publications
Publish Year: 2019
Language: English
Pages: 386
File Format: PDF
File Size: 5.7 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…