Python for Everyone: Learn and polish your coding skills in Python
- Length: 470 pages
- Edition: 1
- Language: English
- Publisher: BPB Publications
- Publication Date: 2023
- ISBN-10: B0BZZCT9WJ
- Sales Rank: #0 (See Top 100 Books)
A hands-on guide that will help you to write clean and efficient code in Python
Key Features
- Get familiar with the core and advanced Python concepts.
- Work with the most used Data Science libraries in Python.
- Take the first step towards your coding goals with “Python for Everyone“.
Description
Python is one of the most popular programming languages in the world, with a vast community of developers and users. In order to start using Python effectively, it is important to have a strong understanding of its core concepts.
This comprehensive guide provides you with a solid foundation in the fundamental concepts of Python programming. It covers a range of important topics, including working with strings, flow control statements, exception handling, and regular expressions. You will also learn about the essential functions and data structures, and explore the use of pre-built packages to extend Python’s capabilities. Numpy and data visualization with packages like Matplotlib are also discussed in depth, along with the popular data analysis and manipulation package, Pandas. This book is an essential resource for anyone looking to master Python and use its power to tackle real-world projects.
With a strong grasp of these core concepts, you will be well-equipped to write efficient and effective Python code.
What you will learn
- Learn how to write Python code in different IDEs like VSCode and Jupyter Notebook.
- Learn how to work with packages and modules in python.
- Get familiar with Python data science libraries.
- Understand how to use Regular expressions in Python.
- Learn how to write Python comments that are clean, concise, and useful.
Who this book is for
This book is designed to cater to a diverse audience, including students pursuing diplomas, undergraduate, and postgraduate degrees in any branch of Engineering and Science. It is also suitable for programming and software professionals looking to enhance their skills in Python.
Cover Page Title Page Copyright Page Dedication Page About the Authors Acknowledgements Preface Errata Table of Contents 1. Basic Python Introduction Introduction Structure Objectives Benefits of Python Uses of Python Limitations of Python Keywords and reserved words Identifiers Line joining methods Implicit line joining method Using curly braces Using square brackets Using parenthesis Explicit joining method Example 1 Example 2 Print function Different styles to use print function Variables Importance of mnemonic variable names in Python Concept of immutability vs fundamental data types Conclusion Points to remember Questions 2. Concept of Strings in Python Introduction Structure Objectives Reading dynamic input from the keyboard raw_input() input() Using Try Except Using eval function Command Line arguments Python sys.argv Python getopt module Exception getopt.GetoptError Short form options Long form options Python argparse module Python argparse Positional arguments Python argparse positional arguments default values Python argparse argument help Python argparse Data Type Python argparse optional arguments Short names for optional arguments with argparse Python argparse with optional and positional arguments Python argparse with required Python argparse dest action Python argparse append action Allowing or disallowing abbreviations Strings Python multiline strings Python string access Using index Using slice operator In forward direction In backward direction Conclusion Points to remember Questions 3. Concept of Flow Control Statements in Python Introduction Structure Objectives Flow of execution of the program Selection statements/Conditional statements if if-else if-elif-else if-elif-else ladder Iterative statements for while Transfer statements break continue pass in keyword usage Loop patterns Star pattern Printing stars in pyramid shape Alphabet pattern Number pattern Conclusion Points to remember Questions 4. Concept of Exception Handling in Python Introduction Structure Objectives Errors Syntax error Runtime Error Importance of exception handling Python exception hierarchy Customized exception handling Control flow in try-except Case-1 - No raising of exception Case-2 - Exception raised at st3 and corresponding except block is matched Case-3 - Exception raised at st3 and corresponding except block is not matched Case-4 - Exception raised at st5 Case-5 - Exception raised at st6 Exception information printing to the console Try with multiple except blocks Single except block that can handle multiple exceptions Default except block Possible combinations of except block finally except block Control flow in try-except and finally Case-1 - No exception is raised Case-2 - Exception raised at st3 and corresponding except block is matched Case-3 - Exception raised at st3 and corresponding except block is not matched Case-4 - Exception raised at st5 Case-5 - Exception raised at st6 or st7 Nested try-except finally block Control flow in Nested try-except finally block Case-1 - If there is no exception Case-2 - Exception raised at st3 and corresponding except block is matched Case-3 - Exception raised at st3 and corresponding except block is not matched Case-4 - Exception raised at st6 and inner except block is matched Case-5 - Exception raised at st6 and inner except block is not matched but outer except block is matched Case-6 - Exception raised at st6 and both inner and outer except block is not matched Case-7 - Exception raised at st7 and the corresponding except block is matched Case-8 - Exception raised at st7 and the corresponding except block is not matched Case-9 - Exception raised at st8 and the corresponding except block is matched Case-10 - Exception raised at st8 and the corresponding except block is not matched Case-11 - Exception raised at st9 and the corresponding except block is matched Case-12 - Exception raised at st9 and the corresponding except block is not matched Case-13 - Exception raised at st10 Case-14 - Exception raised at st11 or st12 Else block with try-except finally block Conclusion Points to remember Questions 5. Concept of Regular Expressions in Python Introduction Structure Objectives compile() finditer() Character classes Pre-defined character classes Quantifiers Functions of re module match fullmatch search findall sub subn split escape Metacharacters [] (Square brackets) . (Period) ^ (Caret) $ (Dollar) * (Star) + (Plus) ? (Question Mark) {} (Braces) | (Alternation): () (Group) \ (Backslash) r prefix Conclusion Points to remember Questions 6. Concept of Functions in Python Introduction Structure Objectives Functions in Python Function types Built in functions User defined functions Function arguments Positional arguments Keyword arguments Default arguments Variable length arguments Keyword variable length arguments (kwargs) Nested function Python closures Function passing as a parameter Local, global, and non-local variables Local variables Global variables Non-local variables Recursive function Python Lambda functions Nested lambda functions Passing lambda functions to another function Conclusion Points of remember Questions 7. Concept of Data Structures in Python Introduction Structure Objectives List data structure Creating a list Creating an empty list Creating a list when elements are known Creating a list with dynamic input List creation using list() function List creation using split() function Lists versus immutability Accessing elements of list By using index By using index and for loop By using Index and while loop By using list slicing List comprehension List comprehension with for loop List comprehension with for loop and if statement List comprehension with for loop and nested if statement List comprehension with if else statement and for loop Nested list comprehension with for loop Tuple data structure Tuple creation An empty tuple creation Single valued tuple creation Multiple valued tuple creation Using tuple() function Accessing elements of tuple By using index By using index and for loop By using index and while loop By using tuple slicing Tuple versus immutability Tuple comprehension List versus tuple comparison Set data structure Set creation Set comprehension Set comprehension with for loop Set comprehension with for loop and if statement Set comprehension with for loop and nested if statement Set comprehension with if else statement and for loop Dictionary data structure Creation of an empty dictionary By using dict() function By using curly braces only Creation of a dictionary Accessing dictionary Accessing dictionary Deleting dictionary item Dictionary comprehension Dictionary comprehension with for loop Dictionary comprehension with for loop and if statement Dictionary comprehension with for loop and nested if statement Dictionary comprehension with if else statement and for loop Conclusion Points of remember Questions (Long/Short/MCQs) 8. Concept of Packages in Python Introduction Structure Objectives Packages Structure for package of games Using “import” in Packages Accessing objects like variables, functions, classes, and lists Using “from import” in Packages Accessing objects like variables, functions, classes, and lists Using “from import *” in Packages Accessing games package using different approaches Conclusion Points to remember Questions 9. Numpy Introduction Introduction Structure Objectives Similarities between list and numpy array Differences between list and numpy array Numpy arrays creation 1-D array creation using list 1-D array creation using tuple 2-D array creation using Nested lists Array creation with a particular dtype Object type array creation 1-D array creation with arange() function Using linspace() Using zeros() Using ones() Using full() Using eye() Using diag() Using empty() Comparison between zeros and empty Conclusion Points to remember Questions 10. Data Visualization Introduction Introduction Structure Objectives Python data visualization tools Line plot creation by passing 2 ndarrays Adding title, xlabel and ylabel to the line plot Advanced line plot linestyle property color property default color Peep in a shortcut way to set color, marker and linestyle mlc form clm form If no color is mentioned, then default color is blue alpha property linewidth and markersize property markerfacecolor property Customizing the figure size Plotting multiple lines in a same plot Conclusion Points of remember Questions 11. Pandas Introduction Introduction Structure Objectives Pandas Series Pandas Series constructor Creating Pandas Series by passing a list Creating Pandas Series by passing a dictionary Creating Pandas Series by passing a numpy array Accessing elements in Pandas Series Pandas Series slicing Pandas Series filtering Usage of apply method to Pandas Series Aggregating of Pandas Series Pandas DataFrame Pandas DataFrame constructor Pandas DataFrame creation Accessing data in Pandas DataFrame Data modification in Pandas DataFrame Data aggregation in Pandas DataFrame Conclusion Points to remember Questions Index
Donate to keep this site alive
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.