2nd ed. — BPB Publications, 2024. — 270 p. — ISBN 9789355516404.
Introduction to Python Variables, Datatypes and Operators. In this chapter, learners will understand Python software, its installation, and writing programs in IDLE. Going through this chapter, we will cover the fundamentals of variable declaration, datatypes, and so on. Apart from that, Python operators are illustrated with the help of suitable examples.
Conditions and Loops. In this chapter, learners will be able to understand the fundamentals of control statements and implement the logic using if conditions and loops wherever it is necessary. Apart from that, readers will be able to learn the difference between break and continue statements. Learners will also grasp the concepts of the control statements, range() function with the help of examples. The concepts of conditions, loops, range() function, break and continue statements are discussed and illustrated with the help of suitable examples.
Arrays and Functions. Arrays are the variables having similar data types. Arrays in Python contain values corresponding to the same data types, whereas lists, which are somewhat similar to arrays discussed in the next chapter, contain values corresponding to different data types. Arrays can contain more than one value at a time, and indexing is used to refer to array elements. A function in Python is a block of a series of statements that carry out a single or several actions. Code is easier to read, comprehend, and maintain when it is divided into usable, modular chunks because of the use of functions. The ability to reuse code is one benefit of utilizing functions.
Lists, Tuples, Iterators Generators, and Sets. In this chapter, we will discuss the concept of lists, tuples, iterators, and generators. Although all of these are data structures or constructs that are used to keep, iterate through, and modify collections of data, they each have distinctive characteristics.
Dictionaries and Modules. In this chapter, we will learn about dictionaries and modules. A dictionary is a commonly used data structure that returns data as key-value pairs. Dictionaries use key-value pairs to store and retrieve data efficiently. Python uses modules to split code into individual files, which makes it easier to organize and reuse. Import statement is used for implementing modules.
File Handling and Databases. This chapter will cover the topics related to file handling and databases. File handling in Python enables one to work with files using the built-in functions and libraries. In databases, we will discuss the concept of data definition language (DDL) and data manipulation language (DML) commands for database connections.
Object-Oriented Programming. Python supports objectoriented programming (OOP) concepts. This chapter will cover the OOP concepts like classes, objects, inheritance, overriding, and so on. A class is a template for creating objects and is a collection of data members, and methods. An object is an instance of a class. In classes, methods that can perform actions on the object using dot notation are defined within a class.
Regular Expressions, Date and Time. Regular expressions are used to identify patterns in a sequence of strings. To work with the regular expressions in Python, we need to import the re module. The regular expressions help us in searching, matching and manipulating strings based on specific patterns. The datetime module in Python is widely utilized for manipulating dates and times. The current date and time can be
obtained using datetime.now() function. You may get the current date with date.today() function.
Exception Handling. Exception is an error that occurs during the execution of the program, and Exception Handling provides a userfriendly interface to handle the exception and prompts a message to the user stating the reason for such unexpected exceptions, like dividing a number by zero.
NumPy and TKinter. By going through this chapter, learners will acquire the knowledge of Numpy and perform operations on arrays using Numpy. Apart from that, you will be able to work with a GUIbased environment of Python known as Tkinter.
Practice Exercises with Solutions. Learners will be presented with practical activities in the Appendix that include fill-in-the-blank questions, true/false questions, and more. A reader who gains an overview of Python essentials through the appendix will also be better equipped to face technical interviews and prepare for entrance-level examinations.