A Journey to Core Python
Experience the Applications of Tuples, Dictionary, Lists, Operators, Loops, Indexing, Slicing, and Matrices (English Edition)
Mr. Girish Kumar, Dr. Ajay Shriram Kushwah, Ms. Raji Ramakrishnan Nair, Ms. Subhashiny G
- English
- ePUB (mobile friendly)
- Available on iOS & Android
A Journey to Core Python
Experience the Applications of Tuples, Dictionary, Lists, Operators, Loops, Indexing, Slicing, and Matrices (English Edition)
Mr. Girish Kumar, Dr. Ajay Shriram Kushwah, Ms. Raji Ramakrishnan Nair, Ms. Subhashiny G
About This Book
Come and join hands together to learn Python from scratch. This book will help you understand Python from scratch and help you build a career in the field of programming.
Key Features
? Exciting examples and a solid grasp of the principles of Python.
? An easy guide for absolute beginners to enjoy coding while learning.
? Exception handling, OOPs fundamentals, inheritance, and reusability explained in detail.
Description
The book offers to teach a novice programmer the fundamentals of Python programming from the ground up. The book provides a brief history of Python, followed by exploring Python's fundamental concepts, features, and applications in detail.The book explains Python identifiers, keywords, variables, and assignments, as well as basic operators and decision-making statements. This book covers repetitive code, strings and integers (dictionaries), functions and modules (files), exception handling, and object-oriented programming in all of its variants. The book explains concepts with illustrations, thus making it simple for even the most unskilled reader to grasp the basics of the code execution flow.By the end of this book, you will have a firm grasp of all of Python's programming ideas. Additionally, it will help you to prepare for any upcoming job interviews with your comprehensive Python understanding.
What you will learn
? Quickly grasp the concepts of lists, tuples, dictionaries, and functions.
? Examine Python's effective use of exception handling.
? Makes object-oriented programming more understandable.
? Discover when and how to use Python's decision-making statements.
? Use Python to perform and execute file operations.
Who this book is for
This book is for web application developers, entry level developers, and IT graduates who want to learn the entire web application development by developing a solid hold on Python principles. Basic programming knowledge is recommended but not required.
Table of Contents
1. Introduction
2. Basic Syntax
3. Variable Types
4. Basic Operators
5. Decision Making
6. Repeating Code Using Loops
7. Numbers
8. Strings
9. Lists
10. Tuples
11. Dictionaries
12. Functions
13. Modules
14. Files I/O
15. Exception Handling
16. Object-Oriented Programming
Frequently asked questions
Information
CHAPTER 1
Introduction
Introduction
Structure
- History of Python
- Features of Python
- Benefits of Python
- Applications of Python
Objectives
History of Python
Features of Python
- Easy-to-learn: Python hardly has any keywords or reserved words, understandable organization, and unambiguous syntax, which makes the language easy to understand for a student.
- Readable: Python code is distinctly set and noticeable.
- Simple-to-maintain: Python's source code is relatively simple to manage.
- An extensive, conventional libraries: Python's conventional library is portable and cross-platform friendly with Windows, UNIX, and Macintosh operating systems.
- Hands-on approach: Python provides a Do-It-Yourself REPL interpreter to learn the language and library features before moving them into the application. The REPL console can also write small test scripts.
- Compactable: Python can work on various platforms and needs an indistinguishable interface for every platform.
- Extendable: Python interpreter supports low-level modules and helps programmers add or customize their tools for efficient programming.
- Databases: Python provides libraries for data-driven applications to interact with all major commercial databases.
- GUI programming: Python supports GUI applications. It can be produced and ported to different system calls, libraries, and windows systems, for example, Windows MFC, Macintosh, and the X Window system of Unix operating systems.
- Scalable: Python caters to a better organization and upholds wide programs than shell scripting.
- It supports functional and structured programming methods and also OOPs concepts.
- It provides high-level dynamic data types and supports dynamic type checking.
- It supports automatic garbage collection.
- It can also be used as a scripting language or compiled to bytecode for developing a wide range of applications that perform enormous operations.
- Even Python scripts that are executed are compiled to Python bytecode before execution.
- It provides high-level dynamic data types and supports dynamic type checking. It can be easily unified with C, C++, COM, ActiveX, CORBA, and Java using Python APIs.
Benefits of Python
- The presence of third-party modules: The Python Package Index (PyPI) comprises numerous third-party modules, enabling Python to interact with distinct languages and platforms available.
- Broad support libraries: Python provides aĀ large standard library, including internet protocols, string operations, web services tools, and operating system interfaces. Many high-level programming tasks have already been scripted into the standard library, leading to the reduction of the length of code to be written.
- Open source and community development: Python language is constructed beneath an OSI-approved open-source license, making it free to use and distribute, even for commercial purposes.
- Learning ease and support available: Python offers excellent readability and accessible simple-to-learn syntax, which helps beginners adopt the language effectively. The code style guidelines, such as PEP 8, provide rules to aid code formatting. Also, the distinct users and active developers made the internet resource bank rich, leading to the development and continued usage of this programming language. The Python Package Index (PyPI) comprises numerous third-party modules and enables Python to interact with distinct languages.
- Handy data structures: Python holds a built-in list and dictionary data structures and is used to construct data structures with fast runtime. Moreover, it affords dynamic high-level data types, leading to reduction in code length.
- Productivity and speed: Python holds an object-oriented design structure, giving a redesigned procedure control capacities, solid consolidation, text preparing capacities, and its unit testing framework. Each one of these capacities increase profitability. Python is seen as an appropriate choice for building complex multi-protocol network applications.
Applications of Python
- GUI-based desktop applications: Python has a basic structure, modular design, rich tools for text processing, and the capacity to work on different operating systems, making it an acceptable choice for developing desktop-based applications. Several GUI toolkits like wxPython, PyQt, and PyGtkĀ accessible assist designers in making profoundly useful Graphical User Interface (GUI). The different applications created utilizing Python incorporates are:
- Image processing and graphic design applications: Python is used to develop 2D imaging software, for example, Inkscape, GIMP, Paint Shop Pro, and Scribus. It is also used in variable proportions like in 3D animation packages such asĀ Blender, 3ds Max, Cinema 4D, Houdini, Lightwave, and Maya.
- Scientific and Computational Applications: The high speed, productivity, and scope of various tools, like Scientific Python and Numeric Python, make Python an integral part of various applications involving computations and processing of scientific data. Various software are coded in Python, such as 3D modeling software like FreeCAD and finite element method software like Abaqus.
- Games:Ā Python supports the development of games with diverse modules, libraries, and platforms. There are many examples available, and one of those is PySoy. It is a 3D game engine that supports Python 3, and PyGame contains a set of modules providing functionality and a related library for the game's development. Various games are built using Python, such as Battlefield 2, Bridge Commander, and Eve Online.
- Web frameworks and web applications: Python has been used to build various web frameworks, including CherryPy, Django, Pyramid, TurboGears, Bottle, and Flask. These frameworks come up with standard libraries and modules that simplify tasks such as managing content, database interactions, and interfacing with different flavors of internet protocols like HTTP, SMTP, XML-RPC, FTP, and POP. Here are some of the popular web applications based on Python:
- Plone is a content management system
- ERP5 is an open-source ERP used mainly in aerospace, apparel, and banking
- Odoo is a blended suite of different business applications and Google App Engine
- Enterprise and business applications: Python is the most suitable language for coding and has special libraries, extensibility, scalability, and easily readable syntax. Reddit, which was initially developed in Common Lips, was rescripted in Python in the year 2005. Python also came up with different functionalities for the YouTube online video sharing platform.
- Operating systems: Python is often a basic part of Linux distributions. For example, Ubuntu's Ubiquity Installer and Fedora and Red Hat Enterprise Linux's Anaconda Installer are developed in Python. Gentoo Linux used Python for its package management system known as Portage.
- Language development: Python has affected the development of many languages with its design and module architecture. For example, Boo language uses an object model, syntax, and indentation equivalent to Python. Additionally, the syntax of many languages like Apple's Swift, CoffeeScript, Cobra, and OCaml share the features of the Python programming language.
- Prototyping: Other than being brisk and simple to learn, Python has the open-source bit of leeway of being free with the help of a huge network. This helps it to be a favored decision for the development of prototypes. Python allows faster development of its prototype with features like agility, extensibility and scalability, and ease of refactoring code. Python is suited for prototyping primarily due to its scripting nature, ease of writing code, and library support. The availability of a developer network might not be a right pointer for creating prototypes as even JAVA/C# have solid developer networks.
Conclusion
Key terms
- Robust
- Interpreted languages
- Web frameworks
- Django, CherryPy, Pyramid, TurboGears, Bottle, Flask
- Python Package Index
- Python libraries
- Anaconda installer
- GUI toolkits
Questions
- Explain the features of Python.
- Explain the real-world applications of Python.
- What is Python, and who developed it?
- Compare Python with C.
- Python is written in which language?
Name the extension of Python files.. Is Python a purely object-oriented programming language?