Python Programming: A modular approach

Book description

"Python Programming introduces one of the most rapidly evolving and preferred programming language using the concept of modularity. One of the highlights of the text is its in-depth treatment of basic concepts.

Table of contents

  1. Cover
  2. Title
  3. Foreword
  4. Preface
  5. About the Authors
  6. 1. Python Programming: An Introduction
    1. 1.1 IDLE – An Interpreter for Python
    2. 1.2 Python Strings
    3. 1.3 Relational Operators
    4. 1.4 Logical Operators
    5. 1.5 Bitwise Operators
    6. 1.6 Variables and Assignment Statements
    7. Assignment Statement
    8. Shorthand Notation
    9. 1.7 Keywords
    10. 1.8 Script Mode
    11. Summary
    12. Exercises
  7. 2. Functions
    1. 2.1 Built-in Functions
    2. input Function
    3. eval Function
    4. Composition
    5. print Function
    6. type Function
    7. round Function
    8. Type Conversion
    9. min and max Functions
    10. pow Function
    11. Random Number Generation
    12. Functions from math Module
    13. Complete List of Built-in Functions
    14. 2.2 Function Definition and Call
    15. Fruitful Functions vs Void Functions
    16. Function help
    17. Default Parameter Values
    18. Keyword Arguments
    19. 2.3 Importing User-defined Module
    20. 2.4 Assert Statement
    21. 2.5 Command Line Arguments
    22. Summary
    23. Exercises
  8. 3. Control Structures
    1. 3.1 if Conditional Statement
    2. General Form of if Conditional Statement
    3. Conditional Expression
    4. General Form of if-else Conditional Statement
    5. General Form of if-elif-else Conditional Statement
    6. Nested if-elif-else Conditional Statement
    7. 3.2 Iteration (for and while Statements)
    8. 3.2.1 for Loop
    9. General Format of for Statement
    10. 3.2.2 while Loop
    11. General Format of while Statement
    12. Infinite Loops
    13. 3.2.3 while Statement vs. for Statement
    14. 3.2.4 Example: To Print Some Pictures
    15. 3.2.5 Nested Loops
    16. 3.2.6 break, continue, and pass Statements
    17. 3.2.7 Example: To Compute sin(x)
    18. 3.2.8 else Statement
    19. Summary
    20. Exercises
  9. 4. Debugging
    1. 4.1 Testing
    2. An Example: Finding Maximum of Three Numbers
    3. 4.2 Debugging
    4. Summary
    5. Exercises
  10. 5. Scope
    1. 5.1 Objects and Object ids
    2. 5.2 Scope of Objects and Names
    3. 5.2.1 Namespaces
    4. 5.2.2 Scope
    5. LEGB Rule
    6. Summary
    7. Exercises
  11. 6. Strings
    1. 6.1 Strings
    2. 6.1.1 Slicing
    3. 6.1.2 Membership
    4. 6.1.3 Built-in Functions on Strings
    5. Function count
    6. Functions find and rfind
    7. Functions capitalize, title, lower, upper, and swapcase
    8. Functions islower, isupper, and istitle
    9. Function replace
    10. Functions strip, lstrip, and rstrip
    11. Functions split and partition
    12. Function join
    13. Functions isspace, isalpha, isdigit, and isalnum
    14. Function startswith and endswith
    15. Functions encode and decode
    16. List of Functions
    17. 6.2 String Processing Examples
    18. 6.2.1 Counting the Number of Matching Characters in a Pair of Strings
    19. 6.2.2 Counting the Number of Common Characters in a Pair of Strings
    20. 6.2.3 Reversing a String
    21. 6.3 Pattern Matching
    22. 6.3.1 Some Important Definitions
    23. Summary
    24. Exercises
  12. 7. Mutable and Immutable Objects
    1. 7.1 Lists
    2. 7.1.1 Summary of List Operations
    3. 7.1.2 Function list
    4. 7.1.3 Functions append, extend, count, remove, index, pop, and insert
    5. 7.1.4 Function insert
    6. 7.1.5 Function reverse
    7. 7.1.6 Functions sort and reverse
    8. 7.1.7 List Functions
    9. 7.1.8 List Comprehension
    10. 7.1.9 Lists as Arguments
    11. 7.1.10 Copying List Objects
    12. 7.1.11 map, reduce, and filter Operations on a Sequence
    13. 7.2 Sets
    14. 7.2.1 Set Functions add, update, remove, pop, and clear
    15. 7.2.2 Set Functions union, intersection, difference, and symmetric_difference
    16. 7.2.3 Function copy
    17. 7.2.4 Subset and Superset Test
    18. 7.2.5 List of Functions
    19. 7.2.6 Finding Common Factors
    20. 7.2.7 Union and Intersection Operation on Lists
    21. 7.3 Tuples
    22. 7.3.1 Summary of Tuple Operations
    23. 7.3.2 Functions tuple and zip
    24. 7.3.3 Functions count and index
    25. 7.4 Dictionary
    26. 7.4.1 Dictionary Operations
    27. 7.4.2 Deletion
    28. 7.4.3 Function get
    29. 7.4.4 Function update
    30. 7.4.5 Function copy
    31. 7.4.6 List of Functions
    32. 7.4.7 Inverted Dictionary
    33. Summary
    34. Exercises
  13. 8. Recursion
    1. 8.1 Recursive Solutions for Problems on Numeric Data
    2. 8.1.1 Factorial
    3. Iterative Approach
    4. Recursive Approach
    5. 8.1.2 Fibonacci Sequence
    6. Iterative Approach
    7. Recursive Approach
    8. 8.2 Recursive Solutions for Problems on Strings
    9. 8.2.1 Length of a String
    10. 8.2.2 Reversing a String
    11. 8.2.3 Palindrome
    12. 8.3 Recursive Solutions for Problems on Lists
    13. 8.3.1 Flatten a List
    14. 8.3.2 Copy
    15. 8.3.3 Deep Copy
    16. 8.3.4 Permutation
    17. 8.4 Problem of Tower of Hanoi
    18. Summary
    19. Exercises
  14. 9. Files and Exceptions
    1. 9.1 File Handling
    2. 9.2 Writing Structures to a File
    3. 9.3 Errors and Exceptions
    4. 9.4 Handling Exceptions Using try…except
    5. 9.5 File Processing Example
    6. Summary
    7. Exercises
  15. 10. Classes I
    1. 10.1 Classes and Objects
    2. 10.2 Person: An Example of Class
    3. 10.2.1 Destructor
    4. 10.3 Class as Abstract Data Type
    5. 10.4 Date Class
    6. Summary
    7. Exercises
  16. 11. Classes II
    1. 11.1 Polymorphism
    2. 11.1.1 Operator Overloading
    3. Comparing Dates
    4. 11.1.2 Function Overloading
    5. 11.2 Encapsulation, Data Hiding, and Data Abstraction
    6. 11.3 Modifier and Accessor Methods
    7. 11.4 Static Method
    8. 11.5 Adding Methods Dynamically
    9. 11.6 Composition
    10. 11.7 Inheritance
    11. 11.7.1 Single Inheritance
    12. Scope Rule
    13. Extending Scope of int Class Using a User Defined Class
    14. 11.7.2 Hierarchical Inheritance
    15. 11.7.3 Multiple Inheritance
    16. 11.7.4 Abstract Methods
    17. 11.7.5 Attribute Resolution Order for Inheritance
    18. 11.8 Built-in Functions for Classes
    19. Summary
    20. Exercises
  17. 12. List Manipulation
    1. 12.1 Sorting
    2. 12.1.1 Selection Sort
    3. 12.1.2 Bubble Sort
    4. 12.1.3 Insertion Sort
    5. 12.2 Searching
    6. 12.2.1 Linear Search
    7. 12.2.2 Binary Search
    8. 12.3 A Case Study
    9. 12.3.1 Operations for Class Section
    10. Complete Script
    11. 12.4 More on Sorting
    12. 12.4.1 Merge Sort
    13. 12.4.2 Quick Sort
    14. Summary
    15. Exercises
  18. 13. Data Structures I: Stack and Queues
    1. 13.1 Stacks
    2. 13.1.1 Evaluating Arithmetic Expressions
    3. 13.1.2 Conversion of Infix Expression to Postfix Expression
    4. 13.2 Queues
    5. Summary
    6. Exercises
  19. 14. Data Structures II: Linked Lists
    1. 14.1 Introduction
    2. 14.2 Insertion and Deletion at the Beginning of a Linked List
    3. 14.3 Deleting a Node with a Particular Value from a Linked List
    4. 14.4 Traversing a Linked List
    5. 14.5 Maintaining Sorted Linked List While Inserting
    6. 14.6 Stack Implementation Using Linked List
    7. 14.7 Queue Implementation Using Linked List
    8. Summary
    9. Exercises
  20. 15. Data Structures III: Binary Search Trees
    1. 15.1 Definitions and Notations
    2. 15.2 Binary Search Tree
    3. 15.3 Traversal of Binary Search Trees
    4. 15.3.1 Inorder Traversal
    5. 15.3.2 Preorder Traversal
    6. 15.3.3 Postorder Traversal
    7. 15.3.4 Height of a Binary Tree
    8. 15.4 Building Binary Search Tree
    9. Summary
    10. Exercises
  21. 16. More on Recursion
    1. 16.1 Pattern within a Pattern
    2. 16.2 Generalized Eight Queens Problem
    3. 16.3 Knight's Tour Problem
    4. 16.4 Stable Marriage Problem
    5. 16.5 Fractal (Hilbert Curve and Sierpinski Triangle)
    6. 16.6 Sudoku
    7. 16.7 Guidelines on Using Recursion
    8. Summary
    9. Exercises
  22. 17. Graphics
    1. 17.1 2D Graphics
    2. 17.1.1 Point and Line
    3. Axis, Title, and Label
    4. Plotting Multiple Functions in the Same Figure
    5. Multiple Plots
    6. Saving Figure
    7. 17.1.2 Histogram and Pi Chart
    8. 17.1.3 Sine and Cosine Curves
    9. 17.1.4 Graphical Objects: Circle, Ellipse, Rectangle, Polygon, and Arrow
    10. Circle
    11. Ellipse
    12. Rectangle
    13. Polygon
    14. Arrow
    15. 17.2 3D Objects
    16. Box
    17. Sphere
    18. Ring
    19. Cylinder
    20. Arrow
    21. Cone
    22. Curve
    23. 17.3 Animation – Bouncing Ball
    24. Summary
    25. Exercises
  23. 18. Applications of Python
    1. 18.1 Collecting Information from Twitter
    2. Open Authentication
    3. An Example – Collecting User Information
    4. Collecting Followers, Friends, and Tweets of a User
    5. Collecting Tweets Having Specific Words
    6. 18.2 Sharing Data Using Sockets
    7. Client-Server Communication on the Same Machine – A Simple Example
    8. An Echo Server
    9. Accessing Web Data (Downloading a Pdf File)
    10. 18.3 Managing Databases Using Structured Query Language (SQL)
    11. 18.3.1 Database Concepts
    12. 18.3.2 Creating Database and Tables
    13. 18.3.3 Inserting Data into Table
    14. 18.3.4 Retrieving Data from Table
    15. 18.3.5 Updating Data in a Table
    16. 18.3.6 Deleting Data from Table/Deleting Table
    17. 18.4 Developing Mobile Application for Android
    18. 18.4.1 A Simple Application Containing Registration Interface
    19. 18.4.2 Tic-Tac-Toe Game
    20. 18.4.3 Running Kivy Applications on Android
    21. 18.5 Integrating Java with Python
    22. 18.5.1 Accessing Java Collections and Arrays in Python
    23. 18.5.2 Converting Python Collections to Java Collections
    24. 18.5.3 Invoking a Parameterized Java Method from Python
    25. 18.5.4 Invoking Parameterized Python Method from Java
    26. 18.6 Python Chat Application Using Kivy and Socket Programming
    27. Summary
    28. Exercises
  24. Index
  25. Colour Illustrations
  26. copyright

Product information

  • Title: Python Programming: A modular approach
  • Author(s): Kumar Naveen, Taneja Sheetal
  • Release date: January 2017
  • Publisher(s): Pearson Education India
  • ISBN: None