Docsity
Docsity

Prepare-se para as provas
Prepare-se para as provas

Estude fácil! Tem muito documento disponível na Docsity


Ganhe pontos para baixar
Ganhe pontos para baixar

Ganhe pontos ajudando outros esrudantes ou compre um plano Premium


Guias e Dicas
Guias e Dicas


tecnologia e apreendizado de programação python e linux, Exercícios de Inglês Técnico

resumo de exercícios de atividades de programação PYTHON AND LINUX SYSTEM PROGRAMING TECNIQUES

Tipologia: Exercícios

2023

Compartilhado em 23/08/2023

carlos-alberto-batista
carlos-alberto-batista 🇧🇷

1 documento

1 / 813

Toggle sidebar

Esta página não é visível na pré-visualização

Não perca as partes importantes!

bg1
Python
Notes for Professionals
Python®
Notes for Professionals
GoalKicker.com
Free Programming Books
Disclaimer
This is an unocial free book created for educational purposes and is
not aliated with ocial Python® group(s) or company(s).
All trademarks and registered trademarks are
the property of their respective owners
700+ pages
of professional hints and tricks
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Pré-visualização parcial do texto

Baixe tecnologia e apreendizado de programação python e linux e outras Exercícios em PDF para Inglês Técnico, somente na Docsity!

Python Notes for Professionals

Python

Notes for Professionals

GoalKicker.com

Free Programming Books

Disclaimer

This is an unocial free book created for educational purposes and is

not aliated with ocial Python® group(s) or company(s).

All trademarks and registered trademarks are

the property of their respective owners

700+ pages

of professional hints and tricks

Contents

  • About
  • Chapter 1: Getting started with Python Language
    • Section 1.1: Getting Started
    • Section 1.2: Creating variables and assigning values
    • Section 1.3: Block Indentation
    • Section 1.4: Datatypes
    • Section 1.5: Collection Types
    • Section 1.6: IDLE - Python GUI
    • Section 1.7: User Input
    • Section 1.8: Built in Modules and Functions
    • Section 1.9: Creating a module
    • Section 1.10: Installation of Python 2.7.x and 3.x
    • Section 1.11: String function - str() and repr()
    • Section 1.12: Installing external modules using pip
    • Section 1.13: Help Utility
  • Chapter 2: Python Data Types
    • Section 2.1: String Data Type
    • Section 2.2: Set Data Types
    • Section 2.3: Numbers data type
    • Section 2.4: List Data Type
    • Section 2.5: Dictionary Data Type
    • Section 2.6: Tuple Data Type
  • Chapter 3: Indentation
    • Section 3.1: Simple example
    • Section 3.2: How Indentation is Parsed
    • Section 3.3: Indentation Errors
  • Chapter 4: Comments and Documentation
    • Section 4.1: Single line, inline and multiline comments
    • Section 4.2: Programmatically accessing docstrings
    • Section 4.3: Write documentation using docstrings
  • Chapter 5: Date and Time
    • Section 5.1: Parsing a string into a timezone aware datetime object
    • Section 5.2: Constructing timezone-aware datetimes
    • Section 5.3: Computing time dierences
    • Section 5.4: Basic datetime objects usage
    • Section 5.5: Switching between time zones
    • Section 5.6: Simple date arithmetic
    • Section 5.7: Converting timestamp to datetime
    • Section 5.8: Subtracting months from a date accurately
    • Section 5.9: Parsing an arbitrary ISO 8601 timestamp with minimal libraries
    • Section 5.10: Get an ISO 8601 timestamp
    • Section 5.11: Parsing a string with a short time zone name into a timezone aware datetime object
    • Section 5.12: Fuzzy datetime parsing (extracting datetime out of a text)
    • Section 5.13: Iterate over dates
  • Chapter 6: Date Formatting
    • Section 6.1: Time between two date-times
    • Section 6.2: Outputting datetime object to string
    • Section 6.3: Parsing string to datetime object
  • Chapter 7: Enum
    • Section 7.1: Creating an enum (Python 2.4 through 3.3)
    • Section 7.2: Iteration
  • Chapter 8: Set
    • Section 8.1: Operations on sets
    • Section 8.2: Get the unique elements of a list
    • Section 8.3: Set of Sets
    • Section 8.4: Set Operations using Methods and Builtins
    • Section 8.5: Sets versus multisets
  • Chapter 9: Simple Mathematical Operators
    • Section 9.1: Division
    • Section 9.2: Addition
    • Section 9.3: Exponentiation
    • Section 9.4: Trigonometric Functions
    • Section 9.5: Inplace Operations
    • Section 9.6: Subtraction
    • Section 9.7: Multiplication
    • Section 9.8: Logarithms
    • Section 9.9: Modulus
  • Chapter 10: Bitwise Operators
    • Section 10.1: Bitwise NOT
    • Section 10.2: Bitwise XOR (Exclusive OR)
    • Section 10.3: Bitwise AND
    • Section 10.4: Bitwise OR
    • Section 10.5: Bitwise Left Shift
    • Section 10.6: Bitwise Right Shift
    • Section 10.7: Inplace Operations
  • Chapter 11: Boolean Operators
    • Section 11.1: and and or are not guaranteed to return a boolean
    • Section 11.2: A simple example
    • Section 11.3: Short-circuit evaluation
    • Section 11.4: and
    • Section 11.5: or
    • Section 11.6: not
  • Chapter 12: Operator Precedence
    • Section 12.1: Simple Operator Precedence Examples in python
  • Chapter 13: Variable Scope and Binding
    • Section 13.1: Nonlocal Variables
    • Section 13.2: Global Variables
    • Section 13.3: Local Variables
    • Section 13.4: The del command
    • Section 13.5: Functions skip class scope when looking up names
    • Section 13.6: Local vs Global Scope
    • Section 13.7: Binding Occurrence
  • Chapter 14: Conditionals
    • Section 14.1: Conditional Expression (or "The Ternary Operator")
    • Section 14.2: if, elif, and else
    • Section 14.3: Truth Values
    • Section 14.4: Boolean Logic Expressions
    • Section 14.5: Using the cmp function to get the comparison result of two objects
    • Section 14.6: Else statement
    • Section 14.7: Testing if an object is None and assigning it
    • Section 14.8: If statement
  • Chapter 15: Comparisons
    • Section 15.1: Chain Comparisons
    • Section 15.2: Comparison by is vs ==
    • Section 15.3: Greater than or less than
    • Section 15.4: Not equal to
    • Section 15.5: Equal To
    • Section 15.6: Comparing Objects
  • Chapter 16: Loops
    • Section 16.1: Break and Continue in Loops
    • Section 16.2: For loops
    • Section 16.3: Iterating over lists
    • Section 16.4: Loops with an "else" clause
    • Section 16.5: The Pass Statement
    • Section 16.6: Iterating over dictionaries
    • Section 16.7: The "half loop" do-while
    • Section 16.8: Looping and Unpacking
    • Section 16.9: Iterating dierent portion of a list with dierent step size
    • Section 16.10: While Loop
  • Chapter 17: Arrays
    • Section 17.1: Access individual elements through indexes
    • Section 17.2: Basic Introduction to Arrays
    • Section 17.3: Append any value to the array using append() method
    • Section 17.4: Insert value in an array using insert() method
    • Section 17.5: Extend python array using extend() method
    • Section 17.6: Add items from list into array using fromlist() method
    • Section 17.7: Remove any array element using remove() method
    • Section 17.8: Remove last array element using pop() method
    • Section 17.9: Fetch any element through its index using index() method
    • Section 17.10: Reverse a python array using reverse() method
    • Section 17.11: Get array buer information through buer_info() method
    • Section 17.12: Check for number of occurrences of an element using count() method
    • Section 17.13: Convert array to string using tostring() method
    • Section 17.14: Convert array to a python list with same elements using tolist() method
    • Section 17.15: Append a string to char array using fromstring() method
  • Chapter 18: Multidimensional arrays
    • Section 18.1: Lists in lists
    • Section 18.2: Lists in lists in lists in..
  • Chapter 19: Dictionary
    • Section 19.1: Introduction to Dictionary
    • Section 19.2: Avoiding KeyError Exceptions
    • Section 19.3: Iterating Over a Dictionary
    • Section 19.4: Dictionary with default values
    • Section 19.5: Merging dictionaries
    • Section 19.6: Accessing keys and values
    • Section 19.7: Accessing values of a dictionary
    • Section 19.8: Creating a dictionary
    • Section 19.9: Creating an ordered dictionary
    • Section 19.10: Unpacking dictionaries using the ** operator
    • Section 19.11: The trailing comma
    • Section 19.12: The dict() constructor
    • Section 19.13: Dictionaries Example
    • Section 19.14: All combinations of dictionary values
  • Chapter 20: List
    • Section 20.1: List methods and supported operators
    • Section 20.2: Accessing list values
    • Section 20.3: Checking if list is empty
    • Section 20.4: Iterating over a list
    • Section 20.5: Checking whether an item is in a list
    • Section 20.6: Any and All
    • Section 20.7: Reversing list elements
    • Section 20.8: Concatenate and Merge lists
    • Section 20.9: Length of a list
    • Section 20.10: Remove duplicate values in list
    • Section 20.11: Comparison of lists
    • Section 20.12: Accessing values in nested list
    • Section 20.13: Initializing a List to a Fixed Number of Elements
  • Chapter 21: List comprehensions
    • Section 21.1: List Comprehensions
    • Section 21.2: Conditional List Comprehensions
    • Section 21.3: Avoid repetitive and expensive operations using conditional clause
    • Section 21.4: Dictionary Comprehensions
    • Section 21.5: List Comprehensions with Nested Loops
    • Section 21.6: Generator Expressions
    • Section 21.7: Set Comprehensions
    • Section 21.8: Refactoring filter and map to list comprehensions
    • Section 21.9: Comprehensions involving tuples
    • Section 21.10: Counting Occurrences Using Comprehension
    • Section 21.11: Changing Types in a List
    • Section 21.12: Nested List Comprehensions
    • Section 21.13: Iterate two or more list simultaneously within list comprehension
  • Chapter 22: List slicing (selecting parts of lists)
    • Section 22.1: Using the third "step" argument
    • Section 22.2: Selecting a sublist from a list
    • Section 22.3: Reversing a list with slicing
    • Section 22.4: Shifting a list using slicing
  • Chapter 23: groupby()
    • Section 23.1: Example
    • Section 23.2: Example
    • Section 23.3: Example
  • Chapter 24: Linked lists
    • Section 24.1: Single linked list example
  • Chapter 25: Linked List Node
    • Section 25.1: Write a simple Linked List Node in python
  • Chapter 26: Filter
    • Section 26.1: Basic use of filter
    • Section 26.2: Filter without function
    • Section 26.3: Filter as short-circuit check
    • Section 26.4: Complementary function: filterfalse, ifilterfalse
  • Chapter 27: Heapq
    • Section 27.1: Largest and smallest items in a collection
    • Section 27.2: Smallest item in a collection
  • Chapter 28: Tuple
    • Section 28.1: Tuple
    • Section 28.2: Tuples are immutable
    • Section 28.3: Packing and Unpacking Tuples
    • Section 28.4: Built-in Tuple Functions
    • Section 28.5: Tuple Are Element-wise Hashable and Equatable
    • Section 28.6: Indexing Tuples
    • Section 28.7: Reversing Elements
  • Chapter 29: Basic Input and Output
    • Section 29.1: Using the print function
    • Section 29.2: Input from a File
    • Section 29.3: Read from stdin
    • Section 29.4: Using input() and raw_input()
    • Section 29.5: Function to prompt user for a number
    • Section 29.6: Printing a string without a newline at the end
  • Chapter 30: Files & Folders I/O
    • Section 30.1: File modes
    • Section 30.2: Reading a file line-by-line
    • Section 30.3: Iterate files (recursively)
    • Section 30.4: Getting the full contents of a file
    • Section 30.5: Writing to a file
    • Section 30.6: Check whether a file or path exists
    • Section 30.7: Random File Access Using mmap
    • Section 30.8: Replacing text in a file
    • Section 30.9: Checking if a file is empty
    • Section 30.10: Read a file between a range of lines
    • Section 30.11: Copy a directory tree
    • Section 30.12: Copying contents of one file to a dierent file
  • Chapter 31: os.path
    • Section 31.1: Join Paths
    • Section 31.2: Path Component Manipulation
    • Section 31.3: Get the parent directory
    • Section 31.4: If the given path exists
    • Section 31.5: check if the given path is a directory, file, symbolic link, mount point etc
    • Section 31.6: Absolute Path from Relative Path
  • Chapter 32: Iterables and Iterators
    • Section 32.1: Iterator vs Iterable vs Generator
    • Section 32.2: Extract values one by one
    • Section 32.3: Iterating over entire iterable
    • Section 32.4: Verify only one element in iterable
    • Section 32.5: What can be iterable
    • Section 32.6: Iterator isn't reentrant!
  • Chapter 33: Functions
    • Section 33.1: Defining and calling simple functions
    • Section 33.2: Defining a function with an arbitrary number of arguments
    • Section 33.3: Lambda (Inline/Anonymous) Functions
    • Section 33.4: Defining a function with optional arguments
    • Section 33.5: Defining a function with optional mutable arguments
    • Section 33.6: Argument passing and mutability
    • Section 33.7: Returning values from functions
    • Section 33.8: Closure
    • Section 33.9: Forcing the use of named parameters
    • Section 33.10: Nested functions
    • Section 33.11: Recursion limit
    • Section 33.12: Recursive Lambda using assigned variable
    • Section 33.13: Recursive functions
    • Section 33.14: Defining a function with arguments
    • Section 33.15: Iterable and dictionary unpacking
    • Section 33.16: Defining a function with multiple arguments
  • Chapter 34: Defining functions with list arguments
    • Section 34.1: Function and Call
  • Chapter 35: Functional Programming in Python
    • Section 35.1: Lambda Function
    • Section 35.2: Map Function
    • Section 35.3: Reduce Function
    • Section 35.4: Filter Function
  • Chapter 36: Partial functions
    • Section 36.1: Raise the power
  • Chapter 37: Decorators
    • Section 37.1: Decorator function
    • Section 37.2: Decorator class
    • Section 37.3: Decorator with arguments (decorator factory)
    • Section 37.4: Making a decorator look like the decorated function
    • Section 37.5: Using a decorator to time a function
    • Section 37.6: Create singleton class with a decorator
  • Chapter 38: Classes
    • Section 38.1: Introduction to classes
    • Section 38.2: Bound, unbound, and static methods
    • Section 38.3: Basic inheritance
    • Section 38.4: Monkey Patching
    • Section 38.5: New-style vs. old-style classes
    • Section 38.6: Class methods: alternate initializers
    • Section 38.7: Multiple Inheritance
    • Section 38.8: Properties
    • Section 38.9: Default values for instance variables
    • Section 38.10: Class and instance variables
    • Section 38.11: Class composition
    • Section 38.12: Listing All Class Members
    • Section 38.13: Singleton class
    • Section 38.14: Descriptors and Dotted Lookups
  • Chapter 39: Metaclasses
    • Section 39.1: Basic Metaclasses
    • Section 39.2: Singletons using metaclasses
    • Section 39.3: Using a metaclass
    • Section 39.4: Introduction to Metaclasses
    • Section 39.5: Custom functionality with metaclasses
    • Section 39.6: The default metaclass
  • Chapter 40: String Formatting
    • Section 40.1: Basics of String Formatting
    • Section 40.2: Alignment and padding
    • Section 40.3: Format literals (f-string)
    • Section 40.4: Float formatting
    • Section 40.5: Named placeholders
    • Section 40.6: String formatting with datetime
    • Section 40.7: Formatting Numerical Values
    • Section 40.8: Nested formatting
    • Section 40.9: Format using Getitem and Getattr
    • Section 40.10: Padding and truncating strings, combined
    • Section 40.11: Custom formatting for a class
  • Chapter 41: String Methods
    • Section 41.1: Changing the capitalization of a string
    • Section 41.2: str.translate: Translating characters in a string
    • Section 41.3: str.format and f-strings: Format values into a string
    • Section 41.4: String module's useful constants
    • Section 41.5: Stripping unwanted leading/trailing characters from a string
    • Section 41.6: Reversing a string
    • Section 41.7: Split a string based on a delimiter into a list of strings
    • Section 41.8: Replace all occurrences of one substring with another substring
    • Section 41.9: Testing what a string is composed of
    • Section 41.10: String Contains
    • Section 41.11: Join a list of strings into one string
    • Section 41.12: Counting number of times a substring appears in a string
    • Section 41.13: Case insensitive string comparisons
    • Section 41.14: Justify strings
    • Section 41.15: Test the starting and ending characters of a string
    • Section 41.16: Conversion between str or bytes data and unicode characters
  • Chapter 42: Using loops within functions
    • Section 42.1: Return statement inside loop in a function
  • Chapter 43: Importing modules
    • Section 43.1: Importing a module
    • Section 43.2: The all special variable
    • Section 43.3: Import modules from an arbitrary filesystem location
    • Section 43.4: Importing all names from a module
    • Section 43.5: Programmatic importing
    • Section 43.6: PEP8 rules for Imports
    • Section 43.7: Importing specific names from a module
    • Section 43.8: Importing submodules
    • Section 43.9: Re-importing a module
    • Section 43.10: import() function
  • Chapter 44: Dierence between Module and Package
    • Section 44.1: Modules
    • Section 44.2: Packages
  • Chapter 45: Math Module
    • Section 45.1: Rounding: round, floor, ceil, trunc
    • Section 45.2: Trigonometry
    • Section 45.3: Pow for faster exponentiation
    • Section 45.4: Infinity and NaN ("not a number")
    • Section 45.5: Logarithms
    • Section 45.6: Constants
    • Section 45.7: Imaginary Numbers
    • Section 45.8: Copying signs
    • Section 45.9: Complex numbers and the cmath module
  • Chapter 46: Complex math
    • Section 46.1: Advanced complex arithmetic
    • Section 46.2: Basic complex arithmetic
  • Chapter 47: Collections module
    • Section 47.1: collections.Counter
    • Section 47.2: collections.OrderedDict
    • Section 47.3: collections.defaultdict
    • Section 47.4: collections.namedtuple
    • Section 47.5: collections.deque
    • Section 47.6: collections.ChainMap
  • Chapter 48: Operator module
    • Section 48.1: Itemgetter
    • Section 48.2: Operators as alternative to an infix operator
    • Section 48.3: Methodcaller
  • Chapter 49: JSON Module
    • Section 49.1: Storing data in a file
    • Section 49.2: Retrieving data from a file
    • Section 49.3: Formatting JSON output
    • Section 49.4: load vs loads, dump vs dumps
    • Section 49.5: Calling json.tool from the command line to pretty-print JSON output
    • Section 49.6: JSON encoding custom objects
    • Section 49.7: Creating JSON from Python dict
    • Section 49.8: Creating Python dict from JSON
  • Chapter 50: Sqlite3 Module
    • Section 50.1: Sqlite3 - Not require separate server process
    • Section 50.2: Getting the values from the database and Error handling
  • Chapter 51: The os Module
    • Section 51.1: makedirs - recursive directory creation
    • Section 51.2: Create a directory
    • Section 51.3: Get current directory
    • Section 51.4: Determine the name of the operating system
    • Section 51.5: Remove a directory
    • Section 51.6: Follow a symlink (POSIX)
    • Section 51.7: Change permissions on a file
  • Chapter 52: The locale Module
    • Section 52.1: Currency Formatting US Dollars Using the locale Module
  • Chapter 53: Itertools Module
    • Section 53.1: Combinations method in Itertools Module
    • Section 53.2: itertools.dropwhile
    • Section 53.3: Zipping two iterators until they are both exhausted
    • Section 53.4: Take a slice of a generator
    • Section 53.5: Grouping items from an iterable object using a function
    • Section 53.6: itertools.takewhile
    • Section 53.7: itertools.permutations
    • Section 53.8: itertools.repeat
    • Section 53.9: Get an accumulated sum of numbers in an iterable
    • Section 53.10: Cycle through elements in an iterator
    • Section 53.11: itertools.product
    • Section 53.12: itertools.count
    • Section 53.13: Chaining multiple iterators together
  • Chapter 54: Asyncio Module
    • Section 54.1: Coroutine and Delegation Syntax
    • Section 54.2: Asynchronous Executors
    • Section 54.3: Using UVLoop
    • Section 54.4: Synchronization Primitive: Event
    • Section 54.5: A Simple Websocket
    • Section 54.6: Common Misconception about asyncio
  • Chapter 55: Random module
    • Section 55.1: Creating a random user password
    • Section 55.2: Create cryptographically secure random numbers
    • Section 55.3: Random and sequences: shue, choice and sample
    • Section 55.4: Creating random integers and floats: randint, randrange, random, and uniform
    • Section 55.5: Reproducible random numbers: Seed and State
    • Section 55.6: Random Binary Decision
  • Chapter 56: Functools Module
    • Section 56.1: partial
    • Section 56.2: cmp_to_key
    • Section 56.3: lru_cache
    • Section 56.4: total_ordering
    • Section 56.5: reduce
  • Chapter 57: The dis module
    • Section 57.1: What is Python bytecode?
    • Section 57.2: Constants in the dis module
    • Section 57.3: Disassembling modules
  • Chapter 58: The base64 Module
    • Section 58.1: Encoding and Decoding Base64
    • Section 58.2: Encoding and Decoding Base32
    • Section 58.3: Encoding and Decoding Base16
    • Section 58.4: Encoding and Decoding ASCII85
    • Section 58.5: Encoding and Decoding Base85
  • Chapter 59: Queue Module
    • Section 59.1: Simple example
  • Chapter 60: Deque Module
    • Section 60.1: Basic deque using
    • Section 60.2: Available methods in deque
    • Section 60.3: limit deque size
    • Section 60.4: Breadth First Search
  • Chapter 61: Webbrowser Module
    • Section 61.1: Opening a URL with Default Browser
    • Section 61.2: Opening a URL with Dierent Browsers
  • Chapter 62: tkinter
    • Section 62.1: Geometry Managers
    • Section 62.2: A minimal tkinter Application
  • Chapter 63: pyautogui module
    • Section 63.1: Mouse Functions
    • Section 63.2: Keyboard Functions
    • Section 63.3: Screenshot And Image Recognition
  • Chapter 64: Indexing and Slicing
    • Section 64.1: Basic Slicing
    • Section 64.2: Reversing an object
    • Section 64.3: Slice assignment
    • Section 64.4: Making a shallow copy of an array
    • Section 64.5: Indexing custom classes: getitem, setitem and delitem
    • Section 64.6: Basic Indexing
  • Chapter 65: Plotting with Matplotlib
    • Section 65.1: Plots with Common X-axis but dierent Y-axis : Using twinx()
    • Section 65.2: Plots with common Y-axis and dierent X-axis using twiny()
    • Section 65.3: A Simple Plot in Matplotlib
    • Section 65.4: Adding more features to a simple plot : axis labels, title, axis ticks, grid, and legend
    • Section 65.5: Making multiple plots in the same figure by superimposition similar to MATLAB
      • commands Section 65.6: Making multiple Plots in the same figure using plot superimposition with separate plot
  • Chapter 66: graph-tool
    • Section 66.1: PyDotPlus
    • Section 66.2: PyGraphviz
  • Chapter 67: Generators
    • Section 67.1: Introduction
    • Section 67.2: Infinite sequences
    • Section 67.3: Sending objects to a generator
    • Section 67.4: Yielding all values from another iterable
    • Section 67.5: Iteration
    • Section 67.6: The next() function
    • Section 67.7: Coroutines
    • Section 67.8: Refactoring list-building code
    • Section 67.9: Yield with recursion: recursively listing all files in a directory
    • Section 67.10: Generator expressions
    • Section 67.11: Using a generator to find Fibonacci Numbers
    • Section 67.12: Searching
    • Section 67.13: Iterating over generators in parallel
  • Chapter 68: Reduce
    • Section 68.1: Overview
    • Section 68.2: Using reduce
    • Section 68.3: Cumulative product
    • Section 68.4: Non short-circuit variant of any/all
  • Chapter 69: Map Function
    • Section 69.1: Basic use of map, itertools.imap and future_builtins.map
    • Section 69.2: Mapping each value in an iterable
    • Section 69.3: Mapping values of dierent iterables
    • Section 69.4: Transposing with Map: Using "None" as function argument (python 2.x only)
    • Section 69.5: Series and Parallel Mapping
  • Chapter 70: Exponentiation
    • Section 70.1: Exponentiation using builtins: ** and pow()
    • Section 70.2: Square root: math.sqrt() and cmath.sqrt
    • Section 70.3: Modular exponentiation: pow() with 3 arguments
    • Section 70.4: Computing large integer roots
    • Section 70.5: Exponentiation using the math module: math.pow()
    • Section 70.6: Exponential function: math.exp() and cmath.exp()
    • Section 70.7: Exponential function minus 1: math.expm1()
    • Section 70.8: Magic methods and exponentiation: builtin, math and cmath
    • Section 70.9: Roots: nth-root with fractional exponents
  • Chapter 71: Searching
    • Section 71.1: Searching for an element
    • Section 71.2: Searching in custom classes: contains and iter
    • Section 71.3: Getting the index for strings: str.index(), str.rindex() and str.find(), str.rfind()
    • Section 71.4: Getting the index list and tuples: list.index(), tuple.index()
    • Section 71.5: Searching key(s) for a value in dict
    • Section 71.6: Getting the index for sorted sequences: bisect.bisect_left()
    • Section 71.7: Searching nested sequences
  • Chapter 72: Sorting, Minimum and Maximum
    • Section 72.1: Make custom classes orderable
    • Section 72.2: Special case: dictionaries
    • Section 72.3: Using the key argument
    • Section 72.4: Default Argument to max, min
    • Section 72.5: Getting a sorted sequence
    • Section 72.6: Extracting N largest or N smallest items from an iterable
    • Section 72.7: Getting the minimum or maximum of several values
    • Section 72.8: Minimum and Maximum of a sequence
  • Chapter 73: Counting
    • Section 73.1: Counting all occurrence of all items in an iterable: collections.Counter
    • Section 73.2: Getting the most common value(-s): collections.Counter.most_common()
    • Section 73.3: Counting the occurrences of one item in a sequence: list.count() and tuple.count()
    • Section 73.4: Counting the occurrences of a substring in a string: str.count()
    • Section 73.5: Counting occurrences in numpy array
  • Chapter 74: Writing extensions
    • Section 74.1: Hello World with C Extension
    • Section 74.2: C Extension Using c++ and Boost
    • Section 74.3: Passing an open file to C Extensions
  • Chapter 75: The Print Function
    • Section 75.1: Print basics
    • Section 75.2: Print parameters
  • Chapter 76: Regular Expressions (Regex)
    • Section 76.1: Matching the beginning of a string
    • Section 76.2: Searching
    • Section 76.3: Precompiled patterns
    • Section 76.4: Flags
    • Section 76.5: Replacing
    • Section 76.6: Find All Non-Overlapping Matches
    • Section 76.7: Checking for allowed characters
    • Section 76.8: Splitting a string using regular expressions
    • Section 76.9: Grouping
    • Section 76.10: Escaping Special Characters
    • Section 76.11: Match an expression only in specific locations
    • Section 76.12: Iterating over matches using re.finditer
  • Chapter 77: Copying data
    • Section 77.1: Copy a dictionary
    • Section 77.2: Performing a shallow copy
    • Section 77.3: Performing a deep copy
    • Section 77.4: Performing a shallow copy of a list
    • Section 77.5: Copy a set
  • Chapter 78: Context Managers (“with” Statement)
    • Section 78.1: Introduction to context managers and the with statement
    • Section 78.2: Writing your own context manager
    • Section 78.3: Writing your own contextmanager using generator syntax
    • Section 78.4: Multiple context managers
    • Section 78.5: Assigning to a target
    • Section 78.6: Manage Resources
  • Chapter 79: The name special variable
    • Section 79.1: name == 'main'
    • Section 79.2: Use in logging
    • Section 79.3: function_class_or_module.name
  • Chapter 80: Checking Path Existence and Permissions
    • Section 80.1: Perform checks using os.access
  • Chapter 81: Creating Python packages
    • Section 81.1: Introduction
    • Section 81.2: Uploading to PyPI
    • Section 81.3: Making package executable
  • Chapter 82: Usage of "pip" module: PyPI Package Manager
    • Section 82.1: Example use of commands
    • Section 82.2: Handling ImportError Exception
    • Section 82.3: Force install
  • Chapter 83: pip: PyPI Package Manager
    • Section 83.1: Install Packages
    • Section 83.2: To list all packages installed using pip
    • Section 83.3: Upgrade Packages
    • Section 83.4: Uninstall Packages
    • Section 83.5: Updating all outdated packages on Linux
    • Section 83.6: Updating all outdated packages on Windows
    • Section 83.7: Create a requirements.txt file of all packages on the system
    • Section 83.8: Using a certain Python version with pip
    • Section 83.9: Create a requirements.txt file of packages only in the current virtualenv
    • Section 83.10: Installing packages not yet on pip as wheels
  • Chapter 84: Parsing Command Line arguments
    • Section 84.1: Hello world in argparse
    • Section 84.2: Using command line arguments with argv
    • Section 84.3: Setting mutually exclusive arguments with argparse
    • Section 84.4: Basic example with docopt
    • Section 84.5: Custom parser error message with argparse
    • Section 84.6: Conceptual grouping of arguments with argparse.add_argument_group()
    • Section 84.7: Advanced example with docopt and docopt_dispatch
  • Chapter 85: Subprocess Library
    • Section 85.1: More flexibility with Popen
    • Section 85.2: Calling External Commands
    • Section 85.3: How to create the command list argument
  • Chapter 86: setup.py
    • Section 86.1: Purpose of setup.py
    • Section 86.2: Using source control metadata in setup.py
    • Section 86.3: Adding command line scripts to your python package
    • Section 86.4: Adding installation options
  • Chapter 87: Recursion
    • Section 87.1: The What, How, and When of Recursion
    • Section 87.2: Tree exploration with recursion
    • Section 87.3: Sum of numbers from 1 to n
    • Section 87.4: Increasing the Maximum Recursion Depth
    • Section 87.5: Tail Recursion - Bad Practice
    • Section 87.6: Tail Recursion Optimization Through Stack Introspection
  • Chapter 88: Type Hints
    • Section 88.1: Adding types to a function
    • Section 88.2: NamedTuple
    • Section 88.3: Generic Types
    • Section 88.4: Variables and Attributes
    • Section 88.5: Class Members and Methods
    • Section 88.6: Type hints for keyword arguments
  • Chapter 89: Exceptions
    • Section 89.1: Catching Exceptions
    • Section 89.2: Do not catch everything!
    • Section 89.3: Re-raising exceptions
    • Section 89.4: Catching multiple exceptions
    • Section 89.5: Exception Hierarchy
    • Section 89.6: Else
    • Section 89.7: Raising Exceptions
    • Section 89.8: Creating custom exception types
    • Section 89.9: Practical examples of exception handling
    • Section 89.10: Exceptions are Objects too
    • Section 89.11: Running clean-up code with finally
    • Section 89.12: Chain exceptions with raise from
  • Chapter 90: Raise Custom Errors / Exceptions
    • Section 90.1: Custom Exception
    • Section 90.2: Catch custom Exception
  • Chapter 91: Commonwealth Exceptions
    • Section 91.1: Other Errors
    • Section 91.2: NameError: name '???' is not defined
    • Section 91.3: TypeErrors
    • Section 91.4: Syntax Error on good code
    • Section 91.5: IndentationErrors (or indentation SyntaxErrors)
  • Chapter 92: urllib
    • Section 92.1: HTTP GET
    • Section 92.2: HTTP POST
    • Section 92.3: Decode received bytes according to content type encoding
  • Chapter 93: Web scraping with Python
    • Section 93.1: Scraping using the Scrapy framework
    • Section 93.2: Scraping using Selenium WebDriver
    • Section 93.3: Basic example of using requests and lxml to scrape some data
    • Section 93.4: Maintaining web-scraping session with requests
    • Section 93.5: Scraping using BeautifulSoup4
    • Section 93.6: Simple web content download with urllib.request
    • Section 93.7: Modify Scrapy user agent
    • Section 93.8: Scraping with curl
  • Chapter 94: HTML Parsing
    • Section 94.1: Using CSS selectors in BeautifulSoup
    • Section 94.2: PyQuery
    • Section 94.3: Locate a text after an element in BeautifulSoup
  • Chapter 95: Manipulating XML
    • Section 95.1: Opening and reading using an ElementTree
    • Section 95.2: Create and Build XML Documents
    • Section 95.3: Modifying an XML File
    • Section 95.4: Searching the XML with XPath
    • Section 95.5: Opening and reading large XML files using iterparse (incremental parsing)
  • Chapter 96: Python Requests Post
    • Section 96.1: Simple Post
    • Section 96.2: Form Encoded Data
    • Section 96.3: File Upload
    • Section 96.4: Responses
    • Section 96.5: Authentication
    • Section 96.6: Proxies
  • Chapter 97: Distribution
    • Section 97.1: py2app
    • Section 97.2: cx_Freeze
  • Chapter 98: Property Objects
    • Section 98.1: Using the @property decorator for read-write properties
    • Section 98.2: Using the @property decorator
    • Section 98.3: Overriding just a getter, setter or a deleter of a property object
    • Section 98.4: Using properties without decorators
  • Chapter 99: Overloading
    • Section 99.1: Operator overloading
    • Section 99.2: Magic/Dunder Methods
    • Section 99.3: Container and sequence types
    • Section 99.4: Callable types
    • Section 99.5: Handling unimplemented behaviour
  • Chapter 100: Polymorphism
    • Section 100.1: Duck Typing
    • Section 100.2: Basic Polymorphism
  • Chapter 101: Method Overriding
    • Section 101.1: Basic method overriding
  • Chapter 102: User-Defined Methods
    • Section 102.1: Creating user-defined method objects
    • Section 102.2: Turtle example
  • methods Chapter 103: String representations of class instances: str and repr
    • Section 103.1: Motivation
    • Section 103.2: Both methods implemented, eval-round-trip style repr()
  • Chapter 104: Debugging
    • Section 104.1: Via IPython and ipdb
    • Section 104.2: The Python Debugger: Step-through Debugging with pdb
    • Section 104.3: Remote debugger
  • Chapter 105: Reading and Writing CSV
    • Section 105.1: Using pandas
    • Section 105.2: Writing a TSV file
  • Chapter 106: Dynamic code execution with exec and eval
    • Section 106.1: Executing code provided by untrusted user using exec, eval, or ast.literal_eval
    • Section 106.2: Evaluating a string containing a Python literal with ast.literal_eval
    • Section 106.3: Evaluating statements with exec
    • Section 106.4: Evaluating an expression with eval
    • Section 106.5: Precompiling an expression to evaluate it multiple times
    • Section 106.6: Evaluating an expression with eval using custom globals
  • Chapter 107: PyInstaller - Distributing Python Code
    • Section 107.1: Installation and Setup
    • Section 107.2: Using Pyinstaller
    • Section 107.3: Bundling to One Folder
    • Section 107.4: Bundling to a Single File
  • Chapter 108: Data Visualization with Python
    • Section 108.1: Seaborn
    • Section 108.2: Matplotlib
    • Section 108.3: Plotly
    • Section 108.4: MayaVI
  • Chapter 109: The Interpreter (Command Line Console)
    • Section 109.1: Getting general help
    • Section 109.2: Referring to the last expression
    • Section 109.3: Opening the Python console
    • Section 109.4: The PYTHONSTARTUP variable
    • Section 109.5: Command line arguments
    • Section 109.6: Getting help about an object
  • Chapter 110: *args and **kwargs
    • Section 110.1: Using **kwargs when writing functions
    • Section 110.2: Using *args when writing functions
    • Section 110.3: Populating kwarg values with a dictionary
    • Section 110.4: Keyword-only and Keyword-required arguments
    • Section 110.5: Using **kwargs when calling functions
    • Section 110.6: **kwargs and default values
    • Section 110.7: Using *args when calling functions
  • Chapter 111: Garbage Collection
    • Section 111.1: Reuse of primitive objects
    • Section 111.2: Eects of the del command
    • Section 111.3: Reference Counting
    • Section 111.4: Garbage Collector for Reference Cycles
    • Section 111.5: Forcefully deallocating objects
    • Section 111.6: Viewing the refcount of an object
    • Section 111.7: Do not wait for the garbage collection to clean up
    • Section 111.8: Managing garbage collection
  • Chapter 112: Pickle data serialisation
    • Section 112.1: Using Pickle to serialize and deserialize an object
    • Section 112.2: Customize Pickled Data
  • Chapter 113: Binary Data
    • Section 113.1: Format a list of values into a byte object
    • Section 113.2: Unpack a byte object according to a format string
    • Section 113.3: Packing a structure
  • Chapter 114: Idioms
    • Section 114.1: Dictionary key initializations
    • Section 114.2: Switching variables
    • Section 114.3: Use truth value testing
    • Section 114.4: Test for "main" to avoid unexpected code execution
  • Chapter 115: Data Serialization
    • Section 115.1: Serialization using JSON
    • Section 115.2: Serialization using Pickle
  • Chapter 116: Multiprocessing
    • Section 116.1: Running Two Simple Processes
    • Section 116.2: Using Pool and Map
  • Chapter 117: Multithreading
    • Section 117.1: Basics of multithreading
    • Section 117.2: Communicating between threads
    • Section 117.3: Creating a worker pool
    • Section 117.4: Advanced use of multithreads
    • Section 117.5: Stoppable Thread with a while Loop
  • Chapter 118: Processes and Threads
    • Section 118.1: Global Interpreter Lock
    • Section 118.2: Running in Multiple Threads
    • Section 118.3: Running in Multiple Processes
    • Section 118.4: Sharing State Between Threads
    • Section 118.5: Sharing State Between Processes
  • Chapter 119: Python concurrency
    • Section 119.1: The multiprocessing module
    • Section 119.2: The threading module
    • Section 119.3: Passing data between multiprocessing processes
  • Chapter 120: Parallel computation
    • Section 120.1: Using the multiprocessing module to parallelise tasks
    • Section 120.2: Using a C-extension to parallelize tasks
    • Section 120.3: Using Parent and Children scripts to execute code in parallel
    • Section 120.4: Using PyPar module to parallelize
  • Chapter 121: Sockets
    • Section 121.1: Raw Sockets on Linux
    • Section 121.2: Sending data via UDP
    • Section 121.3: Receiving data via UDP
    • Section 121.4: Sending data via TCP
    • Section 121.5: Multi-threaded TCP Socket Server
  • Chapter 122: Websockets
    • Section 122.1: Simple Echo with aiohttp
    • Section 122.2: Wrapper Class with aiohttp
    • Section 122.3: Using Autobahn as a Websocket Factory
    • Section 123.1: Server side Implementation
    • Section 123.2: Client side Implementation
  • Chapter 124: Python Networking
    • Section 124.1: Creating a Simple Http Server
    • Section 124.2: Creating a TCP server
    • Section 124.3: Creating a UDP Server
    • Section 124.4: Start Simple HttpServer in a thread and open the browser
    • Section 124.5: The simplest Python socket client-server example
  • Chapter 125: Python HTTP Server
    • Section 125.1: Running a simple HTTP server
    • Section 125.2: Serving files
    • Section 125.3: Basic handling of GET, POST, PUT using BaseHTTPRequestHandler
    • Section 125.4: Programmatic API of SimpleHTTPServer
  • Chapter 126: Flask
    • Section 126.1: Files and Templates
    • Section 126.2: The basics
    • Section 126.3: Routing URLs
    • Section 126.4: HTTP Methods
    • Section 126.5: Jinja Templating
    • Section 126.6: The Request Object
  • Chapter 127: Introduction to RabbitMQ using AMQPStorm
    • Section 127.1: How to consume messages from RabbitMQ
    • Section 127.2: How to publish messages to RabbitMQ
    • Section 127.3: How to create a delayed queue in RabbitMQ
  • Chapter 128: Descriptor
    • Section 128.1: Simple descriptor
    • Section 128.2: Two-way conversions
  • Chapter 129: tempfile NamedTemporaryFile
    • Section 129.1: Create (and write to a) known, persistent temporary file
  • Chapter 130: Input, Subset and Output External Data Files using Pandas
    • Section 130.1: Basic Code to Import, Subset and Write External Data Files Using Pandas
  • Chapter 131: Writing to CSV from String or List
    • Section 131.1: Basic Write Example
    • Section 131.2: Appending a String as a newline in a CSV file
  • Chapter 132: Unzipping Files
    • Section 132.1: Using Python ZipFile.extractall() to decompress a ZIP file
    • Section 132.2: Using Python TarFile.extractall() to decompress a tarball
  • Chapter 133: Working with ZIP archives
    • Section 133.1: Examining Zipfile Contents
    • Section 133.2: Opening Zip Files
    • Section 133.3: Extracting zip file contents to a directory
    • Section 133.4: Creating new archives
  • Chapter 134: Getting start with GZip
    • Section 134.1: Read and write GNU zip files
  • Chapter 135: Stack
    • Section 135.1: Creating a Stack class with a List Object
    • Section 135.2: Parsing Parentheses
  • Chapter 136: Working around the Global Interpreter Lock (GIL)
    • Section 136.1: Multiprocessing.Pool
    • Section 136.2: Cython nogil:
  • Chapter 137: Deployment
    • Section 137.1: Uploading a Conda Package
  • Chapter 138: Logging
    • Section 138.1: Introduction to Python Logging
    • Section 138.2: Logging exceptions
  • Chapter 139: Web Server Gateway Interface (WSGI)
    • Section 139.1: Server Object (Method)
  • Chapter 140: Python Server Sent Events
    • Section 140.1: Flask SSE
    • Section 140.2: Asyncio SSE
  • Chapter 141: Alternatives to switch statement from other languages
    • Section 141.1: Use what the language oers: the if/else construct
    • Section 141.2: Use a dict of functions
    • Section 141.3: Use class introspection
    • Section 141.4: Using a context manager
  • Chapter 142: List destructuring (aka packing and unpacking)
    • Section 142.1: Destructuring assignment
    • Section 142.2: Packing function arguments
    • Section 142.3: Unpacking function arguments
  • Chapter 143: Accessing Python source code and bytecode
    • Section 143.1: Display the bytecode of a function
    • Section 143.2: Display the source code of an object
    • Section 143.3: Exploring the code object of a function
  • Chapter 144: Mixins
    • Section 144.1: Mixin
    • Section 144.2: Overriding Methods in Mixins
  • Chapter 145: Attribute Access
    • Section 145.1: Basic Attribute Access using the Dot Notation
    • Section 145.2: Setters, Getters & Properties
  • Chapter 146: ArcPy - Cursor Section 146.1: Printing one field's value for all rows of feature class in file geodatabase using Search
    • Section 146.2: createDissolvedGDB to create a file gdb on the workspace
  • Chapter 147: Abstract Base Classes (abc)
    • Section 147.1: Setting the ABCMeta metaclass
    • Section 147.2: Why/How to use ABCMeta and @abstractmethod
  • Chapter 148: Plugin and Extension Classes
    • Section 148.1: Mixins
    • Section 148.2: Plugins with Customized Classes
  • Chapter 149: Immutable datatypes(int, float, str, tuple and frozensets)
    • Section 149.1: Individual characters of strings are not assignable
    • Section 149.2: Tuple's individual members aren't assignable
    • Section 149.3: Frozenset's are immutable and not assignable
  • Chapter 150: Incompatibilities moving from Python 2 to Python
    • Section 150.1: Integer Division
    • Section 150.2: Unpacking Iterables
    • Section 150.3: Strings: Bytes versus Unicode
    • Section 150.4: Print statement vs. Print function
    • Section 150.5: Dierences between range and xrange functions
    • Section 150.6: Raising and handling Exceptions
    • Section 150.7: Leaked variables in list comprehension
    • Section 150.8: True, False and None
    • Section 150.9: User Input
    • Section 150.10: Comparison of dierent types
    • Section 150.11: .next() method on iterators renamed
    • Section 150.12: filter(), map() and zip() return iterators instead of sequences
    • Section 150.13: Renamed modules
    • Section 150.14: Removed operators <> and ``, synonymous with != and repr()
    • Section 150.15: long vs. int
    • Section 150.16: All classes are "new-style classes" in Python
    • Section 150.17: Reduce is no longer a built-in
    • Section 150.18: Absolute/Relative Imports
    • Section 150.19: map()
    • Section 150.20: The round() function tie-breaking and return type
    • Section 150.21: File I/O
    • Section 150.22: cmp function removed in Python
    • Section 150.23: Octal Constants
    • Section 150.24: Return value when writing to a file object
    • Section 150.25: exec statement is a function in Python
    • Section 150.26: encode/decode to hex no longer available
    • Section 150.27: Dictionary method changes
    • Section 150.28: Class Boolean Value
    • Section 150.29: hasattr function bug in Python
  • Chapter 151: 2to3 tool
    • Section 151.1: Basic Usage
  • Chapter 152: Non-ocial Python implementations
    • Section 152.1: IronPython
    • Section 152.2: Jython
    • Section 152.3: Transcrypt
  • Chapter 153: Abstract syntax tree
    • Section 153.1: Analyze functions in a python script
  • Chapter 154: Unicode
    • Section 154.1: Encoding and decoding
  • Chapter 155: Unicode and bytes
    • Section 155.1: Encoding/decoding error handling
    • Section 155.2: File I/O