وبلاگ بلیان

Ultimate Python Programming : Learn Python with 650+ programs, 900+ practice questions, and 5 projects

معرفی کتاب «Ultimate Python Programming : Learn Python with 650+ programs, 900+ practice questions, and 5 projects» نوشتهٔ Deepali Srivastava، منتشرشده توسط نشر BPB Publications در سال 2024. این کتاب در فرمت epub، زبان انگلیسی ارائه شده است. «Ultimate Python Programming : Learn Python with 650+ programs, 900+ practice questions, and 5 projects» در دستهٔ بدون دسته‌بندی قرار دارد.

This book provides a comprehensive and thorough introduction to Python, a popular programming language used by various top companies across various domains. Whether you are a novice starting your programming journey or an experienced programmer looking to expand your skill set, this book is designed to assist you in mastering core Python concepts. Starting with the basics, this book guides you through the setup, basic commands, and key language rules. The book covers important ideas like different types of data, variables, and how to control the flow of your programs. You will also learn about collections for organizing data, functions for reusable code, modules for organizing bigger projects, and object-oriented programming for modeling real-world things. Advanced topics include customizing object behavior, efficient data processing, modifying function behavior, and handling errors gracefully. The book includes many figures and coding examples to give you a visual and... Cover Title Page Copyright Page Dedication Page About the Author Acknowledgement Preface Table of Contents 1. Introduction to Python 1.1 What makes Python so popular 1.2 Python implementation 1.3 Installing Python 1.4 Python Interactive Mode 1.5 Executing a Python Script 1.6 IDLE 1.7 Getting Help 2. Getting Started 2.1 Identifiers 2.2 Python Types 2.3 Objects 2.4 Variables and assignment statement 2.5 Multiple and Pairwise Assignments 2.6 Deleting a name 2.7 Naming convention for constants 2.8 Operators 2.8.1 Arithmetic operators 2.8.2 Relational operators 2.8.3 Logical operators 2.8.4 Identity operators 2.8.5 Membership operators 2.8.6 Bitwise operators 2.9 Augmented assignment statements 2.10 Expressions 2.11 Order of operations: Operator Precedence and Associativity 2.12 Type Conversion 2.13 Statements 2.14 Printing Output 2.15 Getting user input 2.16 Complete programs 2.17 Comments 2.18 Indentation in Python 2.19 Container types 2.20 Mutable and Immutable Types 2.21 Functions and methods 2.22 Importing 2.23 Revisiting interactive mode 2.24 Errors 2.25 PEP8 Exercise 3. Strings 3.1 Indexing 3.2 Strings are immutable 3.3 String Slicing 3.4 String Concatenation and Repetition 3.5 Checking membership 3.6 Adding whitespace to strings 3.7 Creating multiline strings 3.8 String methods 3.9 Case-changing methods 3.10 Character classification methods 3.11 Aligning text within strings 3.12 Removing unwanted leading and trailing characters 3.13 Searching and replacing substrings 3.14 Chaining method calls 3.15 String comparison 3.16 String conversions 3.17 Escape Sequences 3.18 Raw string literals 3.19 String formatting 3.20 String formatting using the format() method of string class 3.21 Representation of text - character encodings Exercise 4. Lists and Tuples 4.1 Accessing individual elements of a list by indexing 4.2 Getting parts of a list by slicing 4.3 Changing an item in a list by index assignment 4.4 Changing a Portion of the list by slice assignment 4.5 Adding an item at the end of the list by using append() 4.6 Adding an item anywhere in the list by using insert() 4.7 Adding multiple items at the end by using extend() or += 4.8 Removing a single element or a slice by using the del statement 4.9 Removing an element by index and getting it by using pop() 4.10 Removing an element by value using remove() 4.11 Removing all the elements by using clear() 4.12 Sorting a List 4.13 Reversing a List 4.14 Finding an item in the list 4.15 Comparing Lists 4.16 Built-in functions used on lists 4.17 Concatenation and Replication 4.18 Using a list with functions from the random module 4.19 Creating a list 4.20 Using range to create a list of integers 4.21 Using the repetition operator to create a list of repeated values 4.22 Creating a list by splitting a string 4.23 Converting a list of strings to a single string using join() 4.24 List of Lists (Nested lists) 4.25 Copying a list 4.26 Shallow copy and deep copy 4.27 Repetition operator with nested lists 4.28 Tuples 4.29 Tuple packing and unpacking Exercise 5. Dictionaries and Sets 5.1 Dictionaries 5.2 Adding new key-value pairs 5.3 Modifying Values 5.4 Getting a value from a key by using the get() method 5.5 Getting a value from a key by using the setdefault() method 5.6 Getting all keys, all values, and all key-value pairs 5.7 Checking for the existence of a key or a value in a dictionary 5.8 Comparing dictionaries 5.9 Deleting key-value pairs from a dictionary 5.10 Creating a Dictionary at run time 5.11 Creating a dictionary from existing data by using dict() 5.12 Creating a dictionary by using the fromkeys() method 5.13 Combining dictionaries 5.14 Nesting of dictionaries 5.15 Aliasing and Shallow vs. Deep Copy 5.16 Introduction to sets 5.17 Creating a set 5.18 Adding and Removing elements 5.19 Comparing sets 5.20 Union, intersection, and difference of sets 5.21 Frozenset Exercise 6. Conditional Execution 6.1 if statement 6.2 else clause in if statement 6.3 Nested if statements 6.4 Multiway selection by using elif clause 6.5 Truthiness 6.6 Short circuit behavior of operators and and or 6.7 Values returned by and and or operators 6.8 if else operator Exercise 7. Loops 7.1 while loop 7.1.1 Indentation matters 7.1.2 Removing all occurrences of a value from the list using the while loop 7.1.3 while loop for input error checking 7.1.4 Storing user input in a list or dictionary 7.2 for loop 7.2.1 Iterating over a string with for loop 7.2.2 Unpacking in for loop header 7.2.3 Iterating over dictionaries and sets 7.2.4 Iterating through a series of integers 7.3 Nesting of Loops 7.3.1 Using nested loops to generate combinations 7.3.2 Iterating over nested data structures 7.4 Premature termination of loops using the break statement 7.5 continue statement 7.6 else block in Loops 7.7 pass statement 7.8 for loop vs. while loop Exercise 8. Looping Techniques 8.1 Iterating in sorted and reversed order 8.2 Iterating over unique values 8.3 Index-Based for loops 8.4 Making in-place changes in a list while iterating 8.5 Skipping some items while iterating 8.6 Using range and len combination to shuffle a sequence 8.7 enumerate function 8.8 Iterating over multiple sequences using zip 8.9 Modifying a collection while iterating in a for loop 8.10 Infinite loop with break 8.11 Avoiding complex logical conditions using break Exercise 9. Comprehensions 9.1 List Comprehensions 9.2 if clause in list comprehension 9.3 Ternary operator in list comprehension 9.4 Modifying a list while iterating 9.5 Getting keys from values in a dictionary using list comprehension 9.6 Using list comprehensions to avoid aliasing while creating lists of lists 9.7 Multiple for clauses and Nested list Comprehensions 9.8 Extracting a column in a matrix 9.9 Dictionary Comprehensions 9.10 Inverting the dictionary 9.11 Set Comprehensions 9.12 When not to use comprehensions Exercise 10. Functions 10.1 Function Definition 10.2 Function call 10.3 Flow of control 10.4 Parameters and Arguments 10.5 No type checking of arguments 10.6 Local Variables 10.7 return statement 10.8 Returning Multiple Values 10.9 Semantics of argument passing 10.9.1 Why study argument passing 10.9.2 Pass by assignment 10.9.3 Assignment inside function rebounds the parameter name 10.9.4 Immutables vs Mutables as arguments 10.9.5 How to get the changed value of an immutable type 10.9.6 How to prevent change in mutable types 10.9.7 Digression for programmers from other languages 10.9.8 Advantages of Python’s information passing 10.10 Default Arguments 10.11 Default arguments that could change over time 10.12 Positional and Keyword Arguments 10.13 Unpacking Arguments 10.14 Variable number of positional arguments 10.15 Variable number of keyword arguments 10.16 Keyword-only arguments 10.17 Positional-Only Arguments 10.18 Multiple Unpackings in a Python Function Call 10.19 Arguments and Parameters summary 10.20 Function Objects 10.21 Attributes of a function 10.22 Doctrsings 10.23 Function Annotations 10.24 Recursive Functions Exercise 11. Modules and Packages 11.1 Modules 11.2 Types of modules 11.3 Exploring modules 11.4 Creating and naming a new module 11.5 Importing a module 11.6 Importing all names from a module 11.7 Restricting names that can be imported 11.8 Importing individual names from a module 11.9 Using an alias while importing 11.10 Documenting a module 11.11 Module search Path 11.12 Module object 11.13 Byte compiled version of a module 11.14 Reloading a module 11.15 Scripts and modules 11.16 Packages 11.17 Importing a package and its contents 11.18 Subpackages 11.19 Relative imports Exercise 12. Namespaces and Scope 12.1 Namespaces 12.2 Inspecting namespaces 12.3 Scope 12.4 Name Resolution 12.5 global statement 12.6 nonlocal statement Exercise 13. Files 13.1 Opening a File 13.2 File opening modes 13.3 Buffering 13.4 Binary and Text Files 13.5 Closing a file 13.6 with statement 13.7 Random Access 13.8 Using seek in text mode 13.9 Calling seek in append mode 13.10 Reading and writing to the same file 13.11 Reading a File using read() 13.12 Line oriented reading 13.13 Writing to a file 13.14 Redirecting output of print to a file 13.15 Example Programs 13.16 File Related Modules 13.17 Command Line Arguments 13.18 Storing and Retrieving Python objects using pickle Exercise Project : Hangman Game 14. Object Oriented Programming 14.1 Programming Paradigms 14.2 Introduction to object-oriented programming 14.3 Defining Classes and Creating Instance Objects 14.4 Adding methods to the class 14.5 Adding instance variables 14.6 Calling a method inside another method 14.7 Common pitfalls 14.8 Initializer 14.9 Data Hiding 14.10 Class Variables 14.11 Class and object namespaces 14.12 Changing a class variable through an instance 14.13 Class Methods 14.14 Creating alternative initializers using class Methods 14.15 Static Methods 14.16 Creating Managed Attributes using properties 14.16.1 Creating read only attributes using properties 14.16.2 Creating Computed attributes using properties 14.16.3 Deleter method of property 14.17 Designing a class Exercise Project : Quiz creation Project : Snakes and Ladders Game Project : Log in system 15. Magic Methods 15.1 Overloading Binary Arithmetic operators 15.2 Reverse methods 15.3 In-place methods 15.4 Magic Methods for comparison 15.5 Comparing objects of different classes 15.6 String representation of an instance object 15.7 Construction and destruction of objects 15.8 Making instance objects callable 15.9 Overloading type conversion functions 15.10 List of magic methods Exercise Project : Date Class 16. Inheritance and Polymorphism 16.1 Inheriting a class 16.2 Adding new methods and data members to the derived class 16.3 Overriding a base Method 16.4 Invoking the base class methods 16.5 Multilevel Inheritance 16.6 object class 16.7 Multiple Inheritance 16.8 Method Resolution Order (MRO) 16.9 super and MRO 16.10 Polymorphism 16.11 Abstract Base classes 16.12 Composition Exercise 17. Iterators and Generators 17.1 Iterables 17.2 Iterators 17.3 for loop Iteration Context – How for loop works 17.4 Iteration Tools 17.5 Iterator vs Iterable 17.6 Creating your own Iterator 17.7 Making your class Iterable 17.8 Some More Iterators 17.9 Lazy evaluation 17.10 itertools Module 17.11 Generators 17.12 Generator function vs Normal function 17.13 Generator expressions Exercise 18. Decorators 18.1 Prerequisites for understanding decorators 18.2 Introduction to decorators 18.3 Writing your first decorator 18.4 Applying your decorator to multiple functions 18.5 Automatic decoration syntax 18.6 Decorator Example: Timer 18.7 Decorator Example: Logger 18.8 Decorator Example: Counting function calls 18.9 Applications of decorators 18.10 Decorating functions that take arguments 18.11 Returning values from decorated functions 18.12 Decorator Example: Checking return values 18.13 Decorator Example: Checking argument values 18.14 Applying Multiple Decorators 18.15 Preserving metadata of a function after decoration 18.16 General template for writing a decorator 18.17 Decorators with parameters 18.18 General template for writing a decorator factory 18.19 Decorator factory example 18.20 Applying decorators to imported functions 18.21 Decorating classes 18.22 Class Decorators 18.23 Class Decorators with parameters Exercise 19. Lambda Expressions and Functional Programming 19.1 Lambda expression 19.2 Comparing def statement and lambda expression 19.3 Examples of lambda expressions 19.4 Using Lambda expressions 19.5 Using lambda expressions for returning function objects 19.6 Lambda expressions as closures 19.7 Creating jump tables using lambda functions 19.8 Using lambda expressions in sorted built-in function 19.9 Functional programming 19.10 map 19.11 map with multiple iterables 19.12 filter 19.13 Reducing an iterable 19.14 Built-in reducing functions 19.15 operator module Exercise 20. Exception Handling 20.1 Types of Errors 20.2 Strategies to handle exceptions in your code 20.3 Error Handling by Python (Default exception handling) 20.4 Built-in Exceptions: Python Exceptions Class Hierarchy 20.5 Customized Exception Handling by using try...except 20.6 Catching multiple exceptions using multiple except handlers and single except handler 20.7 How to handle an exception 20.8 Guaranteed execution of finally block 20.9 else Block 20.10 Why do we need an else block 20.11 How to get exception details 20.12 Nested try statements 20.13 Raising Exception 20.14 Re-raising Exception 20.15 Chaining Exceptions 20.16 Creating your own exceptions in Python (Custom exceptions) 20.17 Assertions Exercise 21. Context Managers 21.1 with statement 21.2 Implementing our own context manager 21.3 Exception raised inside with block 21.4 Why we need with statement and context managers 21.5 Runtime context 21.6 Example: Sending output of a portion of code to a file 21.7 Example : Finding time taken by a piece of code 21.8 Using context managers in the standard library 21.9 Nested with statements and multiple context Managers 21.10 Implementing a context manager by using a decorator on a generator Exercise Solutions Index
دانلود کتاب Ultimate Python Programming : Learn Python with 650+ programs, 900+ practice questions, and 5 projects