Python Programming : A Practical Approach book cover
SAVE
$36.00
1st Edition

Python Programming
A Practical Approach



  • Available for pre-order. Item will ship after September 7, 2021
ISBN 9781032028491
September 7, 2021 Forthcoming by Chapman and Hall/CRC
368 Pages 672 B/W Illustrations

 
SAVE ~ $36.00
was $180.00
USD $144.00

Prices & shipping based on shipping country


Preview

Book Description

Maintaining a practical perspective, PYTHON PROGRAMMING - A PRACTICAL APPROACH acquaints you with the wonderful world of programming. The book is a starting point for those want to learn programming, in general Python, without presenting any pre-requisite. Backbone of any programming which is the data structure, components such as strings, lists etc. have been illustrated with proper number of examples and enough practice problems to instil a level of self-confidence in the reader.

Drawing on knowledge gained directly from teaching Computer Science as a subject and working on a wide range of projects related to ML, AI, Deep Learning and Block Chain; the authors have tried their best to present the skills for a Python programmer. Once the foundation of Python programming is built and the readers are aware of the exact structure, dimensions, processing, building blocks and representation of data in Python programming, they can readily take up their specific problems from the area of interest and solve same with the help of Python. These include, but are not limited to, Operators, Control Flow, Strings, Functions, Module Processing, Object Oriented Programming, Exception and File Handling, Multithreading, Synchronization, Regular Expressions and Python Database Programming in detail.

This book on Python programming is specially designed to keep the readers busy with learning fundamentals and generate a sense of confidence building by attempting the assignment problems. We firmly believe that adopting to explaining any particular technology deviates you from learning the fundamentals of a programming language. This book is totally focused on helping the readers attempt the implementation in their areas of interest through the skills imparted through this book. We have taken enough caution to present the real essence of Python programming which you can confidently apply in real implementation by using Python as a tool.

Salient Features:

  • Based on the real-world requirements andsolution.
  • Simple presentation without avoiding necessary details of thetopic.
  • Executable programs on almost everytopic.
  • Plenty of exercise questions, designed to test reader’s skills andunderstanding.

Purposefully designed to be instantly applicable, PYTHON PROGRAMMING – A PRACTICAL APPROACH provides implementation examples so that the described subject matter can be immediately implemented, and reader will try to implement same in the practical problems due to well-known versatility of Python in handling different data types with ease.

Table of Contents

CHAPTER 1

Introduction to Python Programming

1.1

Introduction

1.2

Importance

1.3

Limitations

1.4

Impressions of Python

1.5

How to run Python

1.5.1

From Command Line

1.5.2

From Integrated Development Environment

1.6

Internal working of Python

1.7

Comments in Python

1.8

Conclusion

Review Question

Programming Questions

CHAPTER 2

Basics of Python Programming

2.1

Introduction

2.2

Identifiers

2.2.1

Rules to declare Identifier

2.2.2

Characteristics of Identifier

2.3

Reserved Keywords

2.4

Literals

2.5

Fundamental Data Types

2.5.1

Integer Numbers

2.5.2

Floating Point Numbers

2.5.3

Complex Numbers

2.5.4

Boolean Type

2.5.5

String Type

2.6

Base Conversion

2.7

Type Casting

2.7.1

Integer: int()

2.7.2

Float Point: float()

2.7.3

Complex Number: complex()

2.7.4

Boolean: bool()

2.7.5

String: str()

2.7.6

Bytes Data Type: bytes()

2.7.7

Bytes array Data Type: bytearray()

2.7.8

List: list[]

2.7.9

Tuple: tuple()

2.7.10

Range Data Type: range()

2.7.11

Set Data Type: set{}

2.7.12

Frozenset Data Type: frozenset()

2.7.13

Dictionary Data Type: dict{}

2.7.14

None Data Type: None

2.8

Escape characters

2.9

input() Function

2.10

Evaluate: eval() Function

2.11

Command Line Arguments

2.12

Print: print() Function

2.13

Delete Statement

2.14

Conclusion

2.15

Review Question

Programming Questions

CHAPTER 3

Operators in Python

3.1

Introduction

3.2

Operators

3.2.1

Arithmetic Operators

3.2.2

Relational Operators

3.2.3

Logical Operators

3.2.4

Bitwise Operators

3.2.5

Assignment Operators

3.2.6

Ternary Operator

3.2.7

Special Operators

3.2.7.1

Identity Operator

3.2.7.2

Membership Operator

3.3

Operator Precedence

3.4

Conclusion

Review Question

Programming Questions

CHAPTER 4

Control Flow in Python

4.1

Introduction

4.2

Conditional Statements

4.2.1

if Statement

4.2.2

if-else Statement

4.2.3

if-elif-else Statement

4.3

Iterative Statements

4.3.1

for Loop

4.3.2

while Loop

4.3.3

Nested Loops

4.4

Transfer Statements

4.4.1

break Statement

4.4.2

continue Statement

4.4.3

pass Statement

4.5

Loop with else Block

4.6

Conclusion

Review Question

Programming Questions

CHAPTER 5

String

5.1

Introduction

5.2

Multiline String Literals

5.3

Accessing Characters of String

5.3.1

By using Index

5.3.2

By using Slice Operator

5.3.2.1

Behavior of Slice Operator

5.3.2.2

Slice Operator Case Study

5.4

Mathematical Operators for String

5.5

len() Function

5.6

Checking Membership

5.7

String Operations

5.7.1

Comparison of Strings

5.7.2

Removing Spaces from String

5.7.3

Finding Substrings

5.7.4

index()

5.7.5

Methods to count substring in the main String

5.7.6

Replacing a String with another String

5.7.7

Splitting of Strings

5.7.8

Methods to join the Strings

5.7.9

Methods to change the case of a String

5.7.10

Methods to check the start and end part of String

5.7.11

Methods for checking the type of characters

5.8

Formatting of the Strings

5.8.1

Case 1-Formatting (default, positional & keyword arguments)

5.8.2

Case 2: Formatting of Numbers

5.8.3

Case 3: Formatting for Signed Numbers

5.8.4

Case 4: Number formatting with Alignment

5.8.5

Case 5: String formatting with format()

5.8.6

Case 6: Truncating Strings using format() method

5.8.7

Case 7: Formatting Dictionary Members using format() method

5.8.8

Case 8: Formatting Class Members using format()

5.8.9

Case 9: Dynamic Formatting using format()

5.8.10

Case 10: Dynamic Float format Template

5.8.11

Case 11: Formatting Date values

5.8.12

Case 12: Formatting complex numbers

5.9

Conclusion

Review Question

Programming Questions

CHAPTER 6

Data Structures in Python

6.1

Introduction

6.2

List

6.2.1

Creation of List Objects

6.2.1.1

With Dynamic Input

6.2.1.2

With list() Function

6.2.1.3

With split() Function

6.2.2

Accessing Elements of List

6.2.2.1

By using Index

6.2.2.2

By using Slice Operator

6.2.3

List vs Mutability

6.2.4

Traversing the Elements of List

6.2.4.1

By using while loop

6.2.4.2

By using for loop

6.2.5

Important Functions of List

6.2.5.1

To get Information about list

6.2.5.2

Manipulating Elements of List

6.2.5.3

Ordering Elements of List

6.2.6

Aliasing and Cloning of List Objects

6.2.6.1

By using Slice Operator

6.2.6.2

By using copy() function

6.2.7

Using Mathematical Operators for List Objects

6.2.7.1

Concatenation Operator(+)

6.2.7.2

Repetition Operator(*)

6.2.8

Comparing List Objects

6.2.9

Membership Operators

6.2.10

clear() Function

6.2.11

Nested List

6.2.12

List Comprehensions

6.3

Tuple

6.3.1

Tuple Creation

6.3.2

Accessing Elements of Tuple

6.3.2.1

By using Index

6.3.2.2

By using slice() operator

6.3.3

Tuple vs Immutability

6.3.4

Mathematical Operators for Tuple

6.3.5

Important Functions of Tuple

6.3.6

Tuple Packing and Unpacking

6.3.7

Tuple Comprehension

6.4

Set

6.4.1

Creation of Set Objects

6.4.2

Accessing Elements of List

6.4.3

Important Functions of Set

6.4.4

Mathematical Operations on the Set

6.4.5

Set Comprehension

6.5

Dictionary

6.5.1

Creating Dictionary

6.5.2

Accessing data from Dictionary

6.5.3

Updating Dictionary

6.5.4

Deleting Elements from Dictionary

6.5.5

Important Functions of Dictionary

6.5.6

Dictionary Comprehension

6.6

Conclusion

Review Question

Programming Questions

CHAPTER 7

Functions

7.1

Introduction

7.2

Types of Functions

7.2.1

Built-in Functions

7.2.2

User-Defined Functions

7.3

Return Statement

7.4

Arguments in a Function

7.4.1

Positional Arguments

7.4.2

Keyword Arguments

7.4.3

Default Arguments

7.4.4

Variable Length Arguments

7.5

Scope of Variables

7.5.1

Global Variables

7.5.2

Local Variables

7.6

Global Keyword

7.7

Recursive Function

7.8

Lambda Function

7.9

filter() Function

7.10

map() Function

7.11

reduce() Function

7.12

Function Aliasing

7.13

Nested Functions

7.14

Decorator Function

7.14.1

Calling of a same function with using and without using Decorator

7.14.2

Decorator Chaining

7.15

Generator Function

7.16

Conclusion

Review Question

Programming Questions

CHAPTER 8

Modules

8.1

Introduction

8.2

Module Aliasing

8.3

Member Aliasing

8.4

Reloading a Module

8.5

dir() Function

8.6

Math Module

8.7

Random Module

8.8

Packages

8.9

Conclusion

Review Question

Programming Questions

CHAPTER 9

Basic Concepts of Object Oriented Programming

9.1

Introduction

9.2

Class

9.3

Object

9.4

self-Variable

9.5

Constructor

9.6

Types of Variables

9.6.1

Instance Variable

9.6.1.1

Declaring Instance Variable

9.6.1.2

Accessing Instance Variables

9.6.1.3

 

Deleting Instance Variables

9.6.2

Static Variables

9.6.2.1

Declaration of Static Variables

9.6.2.2

Accessing Static Variables

9.6.2.3

Deleting Static Variables

9.6.3

Local Variables

9.7

Types of Methods

9.7.1

Instance Method

9.7.2

Class Method

9.7.3

Static Method

9.8

Setter and Getter Methods

9.9

Passing Members of One Class to Other Class

9.10

Conclusion

Review Question

Programming Questions

CHAPTER 10

Advanced Concepts of Object Oriented Programming

10.1

Introduction

10.2

Inner Class

10.3

Garbage Collection

10.4

Destructor

10.5

Finding number of References of an Object

10.6

Encapsulation

10.7

Inheritance

10.7.1

By Composition (HAS-A Relationship)

10.7.2

By Inheritance (IS-A Relationship)

10.8

Aggregation vs Composition

10.9

Inheritance

10.9.1

Single Inheritance

10.9.2

Multilevel Inheritance

10.9.3

Hierarchical Inheritance

10.9.4

Multiple Inheritance

10.9.5

Hybrid Inheritance

10.9.6

Cyclic Inheritance

10.10

Method Resolution Order (MRO)

10.11

super() Method

10.11.1

Calling Method of a specific Super Class

10.12

Polymorphism

10.12.1

Duck Typing Philosophy of Python

10.12.2

Overloading

10.12.2.1

Operator Overloading

10.12.2.2

Method Overloading

10.12.2.3

Constructor Overloading

10.12.3

Overriding

10.12.3.1

Method Overriding

10.13

Abstract Class

10.14

Abstract Method

10.15

Interface

10.15.1

Concrete Class vs Abstract Class vs Interface

10.15.2

Public, Protected and Private Attributes

10.16

_str_() Method

10.17

Conclusion

Review Question

Programming Questions

CHAPTER 11

Exception Handling

11.1

Introduction

11.2

Type of Errors

11.3

Exception

11.4

Default Exception Handing

11.5

Customized Exception Handling : using try-except

11.6

Multiple Except Blocks

11.6.1

Multiple Exceptions in a single Except Block

11.6.2

Default Except Block

11.7

The finally Block

11.7.1

Control Flow in try-except-finally

11.8

Nested try-except-finally Block

11.8.1

Control Flow in Nested try-except-finally Block

11.8.2

else Block with try-except-finally

11.9

Types of Exception

11.10

Raise User-Defined Exception

11.11

Assertion

11.12

Conclusion

Review Question

Programming Questions

CHAPTER 12

File Handling

12.1

Introduction

12.1.1

Opening and Closing a File

12.1.2

Attributes of File Object

12.1.3

Writing and Reading Data to Text Files

12.2

The with Statement

12.3

The seek() and tell() Methods

12.3.1

tell() Method

12.3.2

seek() Method

12.4

Testing the existence of File

12.5

Handling Binary Data

12.6

Handling CSV Files

12.6.1

Writing Data to CSV File

12.6.2

Reading Data from CSV File

12.7

Zipping and Unzipping Files

12.7.1

To Create Zip File

12.7.2

To perform Unzip Operations

12.8

Directory

12.8.1

Operations on Directory

12.9

To get Information about a File

12.9.1

Displaying Statistics of a File

12.9.2

To print specified properties

12.10

Pickling and Unpickling of Objects

12.10.1

Reading and Writing the state-of-objects

12.10.2

Writing Multiple Objects

12.11

Conclusion

Review Question

Programming Questions

CHAPTER 13

Multithreading

13.1

Introduction

13.2

Ways of Creating Thread

13.2.1

Creating a Thread without using any class

13.2.2

Creation of Thread by extending thread class

13.2.3

Creating a Thread without extending thread class

13.3

Setting and Getting Name of a Thread

13.4

Thread Identification Number

13.5

active_count() Function

13.6

enumerate() Function

13.7

isAlive() Method

13.8

join() Method

13.9

Daemon Thread

13.10

Conclusion

Review Question

Programming Questions

CHAPTER 14

Synchronization

14.1

Introduction

14.1.1

By using Lock Concept

14.1.2

By using RLock

14.1.3

By using Semaphore

14.2

Inter Thread Communication

14.2.1

By using Event Objects

14.2.2

By using Condition Object

14.2.3

By using Queue

14.3

Variants of Queue

14.3.1

First-In-First-Out Queue

14.3.2

Last-In-First-Out Queue

14.3.3

Priority Queue

14.4

Usage of Locks

14.5

Conclusion

Review Question

Programming Questions

CHAPTER 15

Regular Expressions & Web Scraping

15.1

Introduction

15.1.1

Character Classes

15.1.2

Pre-defined Character Classes

15.1.3

Quantifiers

15.2

Functions of Re-module

15.2.1

match()

15.2.2

fullmatch()

15.2.3

search()

15.2.4

findall()

15.2.5

finditer()

15.2.6

sub()

15.2.7

subn()

15.2.8

split()

15.2.9

^ symbol()

15.2.10

$ symbol()

15.3

Web Scraping

Conclusion

Review Question

Programming Questions

Chapter 16

Python Database Programming

16.1

Introduction

16.2

File System

16.3

Database

16.3.1

Python Database Programming

16.3.2

Working with Oracle Database

16.3.2

Working with MySQL Database

APPENDIX A : Mini Projects

APPENDIX B : Socket Programming

APPENDIX C : Parallel Processing

...
View More

Author(s)

Biography

Vijay Kumar Sharma, is an Assistant Professor in the Department of Computer Science & Engineering at MIET, Meerut, (U.P), India. He received his B.Tech Degree in 2012 from Uttar Pradesh Technical University, Lucknow and M.Tech degree in 2017 from Motilal Nehru National Institute of Technology, Allahabad, India. He has published various research papers in International and National Journals and Conferences of high repute. His research interests lies in the area of Cloud Computing, Artificial Intelligence and Blockchain Technology. Various achievements in programming field like winner in ‘Coding Competition Zonal Level 2019’, winner in ‘Smart India Hackathon 2019’, winner of ’India-EU-ICT Smart City Hackathon 2019 Pune’.

Vimal Kumar is an Associate Professor in the Department of Computer Science & Engineering at MIET, Meerut, (U.P), India. He received his B.Tech Degree in 2007 from Uttar Pradesh Technical University, Lucknow and M.Tech degree in Information Security from Motilal Nehru National Institute of Technology, Allahabad, India in 2011. He did his Ph.D in Computer Science and Engineering from MMMEC, Gorakhpur (AKTU, Lucknow), India in 2017. He has published a large number of research papers in International and National journals and conferences of high repute. His research interests lie in Mobile Ad hoc Network, Network Security and Network Forensics.

Swati Sharma did her graduation in Information Technology with Honrs. degree in 2010 and M.Tech with Honrs. degree in 2015. She did her Ph.D. in Computer Science and Engineering. An academician with more than 10 years of teaching experience authored more than a dozen of research papers in reputed Scopus indexed journals, International Journal and IEEE Conferences to her credit. Her areas of interest are Data Mining, Data Analysis, Algorithm Analysis and Design. She is currently doing research in the area of Data Analysis. She has national level certifications on Python and R programming language. She is certified from IBM Db2, RAD, RSA and RTC. She is the prime author of the book, ‘Neural Network and Fuzzy Time Series’ by International publisher Lambert Academic Publishing.

Shashwat Pathak did his graduation in Electronics and Communication Engineering in the year 2009. Later, he completed his Masters in Communication Technology from the Department of Electronics and Communication, University of Allahabad, Prayagraj, India in the year 2012. He earned his Ph.D. from the Department of Electronics and Communication Engineering, Motilal Nehru National Institute of Technology Allahabad, Prayagraj, India (MNNIT Allahabad) in December 2017. His research interest includes Wireless Communication, Telemedicine Systems and Services, Digital Image Processing and designing medical diagnostics & assisting devices for patients. He has received Incubation Offer from Incubation centre, IIT Patna, seed funded by Ministry of Electronics and IT (MeiTY), GoI for his thesis problem’s solution "Portable and Automated Cataract Detection and Grading System". He is co-founder and MD of Electro CurietechPvt. Ltd. which works in the area of Medical Electronics, Telemedicine solutions, office IT solutions and consultancy on sustainability. He is Center In-Charge of Atal Community Innovation Center MIET Meerut Foundation, where he is majorly involved in nurturing students and nearby communities for creating impact making innovations and ventures for social causes.