Thareja | Python Programming | Buch | 978-93-5497-376-5 | www.sack.de

Buch, Englisch, 560 Seiten, Format (B × H): 185 mm x 242 mm, Gewicht: 686 g

Thareja

Python Programming


2. Auflage 2023
ISBN: 978-93-5497-376-5
Verlag: Oxford University Press

Buch, Englisch, 560 Seiten, Format (B × H): 185 mm x 242 mm, Gewicht: 686 g

ISBN: 978-93-5497-376-5
Verlag: Oxford University Press


With a comprehensive introduction to computers, problem solving approaches, programming languages, and object-oriented programming, the book goes on to explore Python programming in detail. Separate chapters covering important constructs of Python language such as control statements, functions, strings, files, data structures, classes and objects, inheritance, operator overloading, and exceptions have been added to make learning simpler for readers. Plenty of chapter-end exercises including those on programming and debugging will be useful for students.

Thareja Python Programming jetzt bestellen!

Autoren/Hrsg.


Weitere Infos & Material


- Detailed Contents

- Preface v

- Brief Contents viii

- 1 Introduction to Computers and

- Problem Solving Strategies

-

-

- 1.1 Introduction 1

- 1.2 What is a Computer? 1

- 1.3 History of Computers 2

- 1.4 Characteristics of Computers 4

- 1.5 Classification of Computers 5

- 1.6 Basic Applications of

- Computers 9

- 1.7 Stored Program Concept 11

- 1.7.1 Types of Stored Program

- Computers 12

-

- 1.8 Components and Functions of a

- Computer System 12

- 1.9 Concept of Hardware and

- Software 14

- 1.9.1 Hardware 14

- 1.9.2 Software 14

-

- 1.10 Central Processing Unit (CPU): Basic

- Architecture 14

- 1.11 Input and Output Devices 16

- 1.12 Computer Memory 17

- 1.12.1 Memory Hierarchy 18

- 1.12.2 Primary Memory 18

- 1.12.3 Secondary Storage Devices 20

-

- 1.13 Classification of Computer

- Software 20

-

- 1.13.1 System Software 22

- 1.13.2 Application Software 27

-

- 1.14 Representation of Data: Bits and

- Bytes 29

- 1.15 Problem Solving Strategies 31

-

- 1.15.1 Fundamentals of Computing -

- Identification of Computational

- Problems 32

-

- 1.16 Program Design Tools: Algorithms,

- Flowcharts, Pseudocodes 33

- 1.16.1 Algorithms 33

- 1.16.2 Flowcharts 38

- 1.16.3 Pseudocodes 40

-

-

- 1.17 Types of Errors 42

- 1.18 Testing and Debugging

- Approaches 43

- 2 Introduction to Object Oriented

- Programming (OOP)

-

-

- 2.1 Computer Programming and

- Programming Languages 53

- 2.2 Generations of Programming

- Languages 54

-

- 2.2.1 First Generation: Machine

- Language 54

- 2.2.2 Second Generation: Assembly

- Language 55

- 2.2.3 Third Generation: High-level

- Language 56

- 2.2.4 Fourth Generation: Very

- High-level Languages 57

- 2.2.5 Fifth Generation Programming

- Language 58

-

- 2.3 Programming Paradigms 59

-

- 2.3.1 Monolithic Programming 59

- 2.3.2 Procedural Programming 59

- 2.3.3 Structured Programming 60

- 2.3.4 Object Oriented Programming

- (OOP) 61

-

- 2.4 Features of Object Oriented

- Programming 62

-

- 2.4.1 Classes 62

- 2.4.2 Objects 63

- 2.4.3 Method and Message Passing

- 2.4.4 Inheritance 64

- 2.4.5 Polymorphism 65

- 2.4.6 Containership 65

- 2.4.7 Reusability 65

- 2.4.8 Delegation 66

- 2.4.9 Data Abstraction and

- Encapsulation 66

-

-

- 2.5 Merits and Demerits of Object

- Oriented Programming Language 67

-

-

-

- Detailed Contents

-

- 4 Decision Control Statements

-

- 2.6 Applications of Object Oriented

- Programming 67

- 2.7 Differences Between Popular

- Programming Languages 68

- 3 Basics of Python Programming

-

-

- 3.1 Features of Python 73

- 3.2 History of Python 75

- 3.3 The Future of Python 77

- 3.4 Writing and Executing First Python

- Program 77

-

- 3.4.1 Internal Working of Python 78

- 3.4.2 Python Tokens 79

-

- 3.5 Literal Constants 79

-

- 3.5.1 Numbers 79

- 3.5.2 Strings 81

- 3.5.3 Slice a String 85

-

- 3.6 Variables and Identifiers 86

- 3.7 Data Types of Identifiers 87

- 3.8 Input Operation 88

- 3.9 Comments 88

- 3.10 Reserved Words 89

- 3.11 Indentation 89

- 3.12 Operators and Expressions 90

-

- 3.12.1 Arithmetic Operators 90

- 3.12.2 Comparison Operators 90

- 3.12.3 Assignment and In-place or

- Shortcut Operators 91

- 3.12.4 Unary Operators 92

- 3.12.5 Bitwise Operators 92

- 3.12.6 Shift Operators 93

- 3.12.7 Logical Operators 94

- 3.12.8 Membership Operators 95

- 3.12.9 Identity Operators 95

- 3.12.10 Operators Precedence and

- Associativity 95

-

- 3.13 Expressions in Python 96

- 3.14 Operations on Strings 97

-

- 3.14.1 Concatenation 97

- 3.14.2 Multiplication (or String

- Repetition) 98

-

- 3.15 Other Data Types 99

-

- 3.15.1 Tuples 99

- 3.15.2 Lists 99

- 3.15.3 Dictionary 100

-

- 3.16 Type Conversion 100

-

-

-

- 4.1 Introduction to Decision Control

- Statements 115

- 4.2 Selection/Conditional Branching

- Statements 116

-

- 4.2.1 if Statement 116

- 4.2.2 if-else Statement 117

- 4.2.3 Nested if Statements 120

- 4.2.4 if-elif-else Statement 120

-

- 4.3 Basic Loop Structures/Iterative

- Statements 125

- 4.3.1 while Loop 125

- 4.3.2 for Loop 133

- 4.3.3 Selecting an Appropriate

- Loop 134

-

- 4.4 Nested Loops 142

- 4.5 The break Statement 145

- 4.6 The continue Statement 146

- 4.7 The pass Statement 149

- 4.8 The else Statement used with

- Loops 150

- Case Study 1 - Simple Calculator 158

- Case Study 2 - Generating a

- Calendar 161

- 5 Functions and Modules

-

-

- 5.1 Introduction 163

-

- 5.1.1 Need for Functions 164

-

- 5.2 Function Definition 165

- 5.3 Function Call 167

-

- 5.3.1 Function Parameters 167

-

- 5.4 Variable Scope and Lifetime 169

-

- 5.4.1 Local and Global Variables 170

- 5.4.2 Using the Global Statement 171

- 5.4.3 Resolution of Names 173

-

- 5.5 The return Statement 174

- 5.6 Fruitful Functions 176

-

- 5.6.1 The return Statement 176

- 5.6.2 Parameters 178

-

- 5.7 Lambda Functions or Anonymous

- Functions 181

- 5.8 Function Composition in Python 185

- 5.9 Documentation Strings 185

- 5.10 Good Programming Practices 186

- 5.11 Recursive Functions 192

-

-

-

- Detailed Contents

-

- 5.11.1 Greatest Common Divisor 194

- 5.11.2 Finding Exponents 195

- 5.11.3 The Fibonacci Series 195

- 5.11.4 Tail Recursion 197

- 5.11.5 Recursion vs Iteration 198

-

- 5.12 Modules 199

-

- 5.12.1 The from…import Statement 200

- 5.12.2 Name of Module 202

- 5.12.3 Making Your Own Modules 202

- 5.12.4 The dir() Function 204

- 5.12.5 The Python Module 205

- 5.12.6 Modules and Namespaces 205

-

- 5.13 Packages in Python 207

- 5.14 Standard Library Modules 208

- 5.15 Globals(), Locals(), and

- Reload() 209

- 5.16 Function Redefinition 210

- Case Study 3 - Tower of Hanoi 219

- Case Study 4 - Shuffling a Deck of

- Cards 221

- 6 Python Strings Revisited

-

- 6.13.1 Character Classes 256

- 6.13.2 Groups 258

- 6.13.3 Application of Regular Expression

- to Extract Email 260

-

- 7 File Handling

-

-

- 7.1 Introduction 271

- 7.2 File Path 271

- 7.3 Types of Files 272

-

- 7.4 Opening and Closing Files 274

-

- 7.4.1 The open() Function 274

- 7.4.2 The File Object Attributes 275

- 7.4.3 The close() Method 276

-

- 7.5 Reading and Writing Files 277

-

- 6.4.1 Additional String Formatting

- Operator Examples 229

-

- 6.5 Built-in String Methods and

- Functions 230

- 6.6 Slice Operation 235

-

- 6.6.1 Specifying Stride While Slicing

- Strings 237

-

- 6.12.1 The match() Function 249

- 6.12.2 The search() Function 250

- 6.12.3 The sub() Function 251

- 6.12.4 The findall() and finditer()

- Functions 251

- 6.12.5 Flag Options 252

-

-

- 6.13 Metacharacters in Regular

- Expression 254

-

- 7.3.1 ASCII Text Files 273

- 7.3.2 Binary Files 273

-

- 6.1 Introduction 222

- 6.2 Concatenating, Appending, and

- Multiplying Strings 223

- 6.3 Strings are Immutable 225

- 6.4 String Formatting Operator 226

-

- 6.7 ord() and chr() Functions 238

- 6.8 in and not in Operators 238

- 6.9 Comparing Strings 239

- 6.10 Iterating String 240

- 6.11 The String Module 246

- 6.12 Regular Expressions 249

-

- 6.12.6 Using Verbose in Regular

- Expression 253

-

- 7.5.1 write() and writelines()

- Methods 277

- 7.5.2 append() Method 277

- 7.5.3 The read() and readline()

- Methods 278

- 7.5.4 Opening Files using with

- Keyword 280

- 7.5.5 Splitting Words 281

- 7.5.6 Opening Files using Command

- Line Arguments 282

- 7.5.7 Some Other Useful File

- Methods 282

-

- 7.6 File Positions 283

-

- 7.6.1 Seek a Position in a File 284

-

- 7.7 Renaming and Deleting Files 286

- 7.8 Directory Methods 287

- 7.8.1 Methods from the os

- Module 290

- 7.8.2 Get File Permissions 296

- 7.8.3 Set File Permissions

- (CHMOD) 296

- 7.8.4 Change Ownership

- (CHOWN) 297

- 7.8.5 Get File Timestamp 297

- 7.8.6 Set File Timestamp 298

- 7.8.7 Symlink 298

-

-

-

- Detailed Contents

-

- Case Study 5 - Creating a Hash File (or a

- message digest of a file) 305

- Case Study 6 - Mail Merge Program 307

- Case Study 7 - Finding Resolution of an

- Image 309

- 8 Data Structures

-

-

- 8.1 Sequence 310

- 8.2 Lists 310

-

- 8.2.1 Access Values in Lists 311

- 8.2.2 Updating Values in Lists 311

- 8.2.3 Nested Lists 313

- 8.2.4 Cloning Lists 314

- 8.2.5 Basic List Operations 314

- 8.2.6 List Aliasing 315

- 8.2.7 List Cloning 316

- 8.2.8 List Methods 316

- 8.2.9 Using Lists as Stack 319

- 8.2.10 Using Lists as Queues 320

- 8.2.11 List Comprehensions 321

- 8.2.12 Looping in Lists 323

-

- 8.3 Functional Programming 325

- 8.3.1 filter() Function 325

- 8.3.2 map() Function 326

- 8.3.3 reduce() Function 327

-

- 8.4 Tuple 336

-

- 8.4.1 Creating Tuple 336

- 8.4.2 Utility of Tuples 338

- 8.4.3 Accessing Values in a Tuple 338

- 8.3.4 Updating Tuple 339

- 8.4.5 Deleting Elements in Tuple 339

- 8.4.6 Basic Tuple Operations 340

- 8.4.7 Tuple Assignment 340

- 8.4.8 Tuples for Returning Multiple

- Values 341

- 8.4.9 Nested Tuples 342

- 8.4.10 Checking the Index: index()

- Method 342

- 8.4.11 Counting the Elements: count()

- Method 343

- 8.4.12 List Comprehension and

- Tuples 343

- 8.4.13 Variable-length Argument

- Tuples 344

- 8.4.14 The zip() Function 345

- 8.4.15 Advantages of Tuple over

- List 347

-

-

- 8.5 Sets 350

-

- 8.5.1 Creating a Set 350

- 8.5.2 Set Comprehensions 358

-

- 8.6 Dictionaries 359

-

- 8.6.1 Creating a Dictionary 360

- 8.6.2 Accessing Values 361

- 8.6.3 Adding and Modifying an Item in a Dictionary 362

- 8.6.4 Modifying an Entry 362

- 8.6.5 Deleting Items 363

- 8.6.6 Sorting Items in a Dictionary 366

- 8.6.7 Looping over a Dictionary 366

- 8.6.8 Nested Dictionaries 366

- 8.6.9 Built-in Dictionary Functions and Methods 367

- 8.6.10 Difference Between a List and a Dictionary 369

- 8.6.11 String Formatting with Dictionaries 370

- 8.6.12 When to use which Data Structure? 370

- 8.6.13 List vs Tuple vs Dictionary vs Set 370

-

-

- 9 Classes and Objects

-

-

- 9.1 Introduction 385

- 9.2 Classes and Objects 385

-

- 9.2.1 Defining Classes 385

- 9.2.2 Creating Objects 386

- 9.2.3 Data Abstraction and Hiding

- through Classes 386

-

- 9.3 Class Method and self

- Argument 387

- 9.4 The __init__() Method (The Class

- Constructor) 388

- 9.5 Class Variables and Object

- Variables 388

- 9.6 The __del__() Method 391

- 9.7 Other Special Methods 392

- 9.8 Public and Private Data

- Members 393

- 9.9 Private Methods 394

- 9.10 Calling a Class Method from Another

- Class Method 395

-

-

- Detailed Contents

-

- 9.11 Built-in Functions to Check, Get, Set,

- and Delete Class Attributes 397

- 9.12 Built-in Class Attributes 398

- 9.13 Garbage Collection (Destroying

- Objects) 399

- 9.14 Class Methods 410

- 9.15 Static Methods 411

- 10 Inheritance

-

-

- 10.1 Introduction 417

- 10.2 Inheriting Classes in Python 418

- 10.2.1 Polymorphism and Method

- Overriding 419

-

- 10.3 Types of Inheritance 422

-

- 10.3.1 Multiple Inheritance 422

- 10.3.2 Multi-level Inheritance 423

- 10.3.3 Multi-path Inheritance 424

-

- 10.4 Composition or Containership or

- Complex Objects 425

- 10.5 Abstract Classes and Interfaces 427

- 10.6 Metaclass 428

- 11 Operator Overloading

- 11.1 Introduction 441

-

- 11.1.1 Concept of Operator

- Overloading 441

- 11.1.2 Advantage of Operator

- Overloading 442

-

- 11.2 Implementing Operator

- Overloading 442

- 11.3 Reverse Adding 451

-

-

-

- 11.4 Overriding __getitem__() and

- __setitem__() Methods 452

- 11.5 Overriding the in Operator 453

- 11.6 Overloading Miscellaneous

- Functions 454

- 11.7 Overriding the __call__()

- Method 455

- 12 Error and Exception Handling

-

-

- 12.1 Introduction to Errors and

- Exceptions 461

- 12.1.1 Syntax Errors 461

- 12.1.2 Logic Error 462

- 12.1.3 Exceptions 462

-

- 12.2 Handling Exceptions 463

- 12.3 Multiple Except Blocks 464

- 12.4 Multiple Exceptions in a Single

- Block 465

- 12.5 Except Block without Exception 466

- 12.6 The else Clause 467

- 12.7 Raising Exceptions 467

- 12.8 Instantiating Exceptions 468

- 12.9 Handling Exceptions in Invoked

- Functions 469

- 12.10 Built-in and User-defined

- Exceptions 471

- 12.11 The finally Block 473

- 12.12 Pre-Defined Clean-up Action 475

- 12.13 Re-raising Exception 476

- 12.14 Assertions in Python 476

- Case Study 8 - Compressing String and

- Files 489

-

- About the Author 493

- Related Titles 494


Dr. Reema Thareja is teaching in the Department of Computer Science, Shyama Prasad Mukherji College, University of Delhi. In her 17 years of teaching experience, she has taught several courses including BA, BSc, MSc, BBA, MBA, BCA, MCA. She has authored several books in Computer Science and her books have been well accepted across the globe. She has published more than 20 researcher papers in international journals of repute. She also launched a free mobile app, Jruma, for Apple as well Android devices to promote incentive-based learning through quizzing. Users can now earn while they learn.

Besides being an author, she is an eminent speaker. Dr. Thareja has conducted several Faculty Development Programs, Seminars, Webinars and Students Workshop in India and the US. She was also invited as a speaker for the Global Virtual Summit in New York.



Ihre Fragen, Wünsche oder Anmerkungen
Vorname*
Nachname*
Ihre E-Mail-Adresse*
Kundennr.
Ihre Nachricht*
Lediglich mit * gekennzeichnete Felder sind Pflichtfelder.
Wenn Sie die im Kontaktformular eingegebenen Daten durch Klick auf den nachfolgenden Button übersenden, erklären Sie sich damit einverstanden, dass wir Ihr Angaben für die Beantwortung Ihrer Anfrage verwenden. Selbstverständlich werden Ihre Daten vertraulich behandelt und nicht an Dritte weitergegeben. Sie können der Verwendung Ihrer Daten jederzeit widersprechen. Das Datenhandling bei Sack Fachmedien erklären wir Ihnen in unserer Datenschutzerklärung.