An Introduction to Python Programming: A Practical Approach
eBook - ePub

An Introduction to Python Programming: A Practical Approach

step-by-step approach to Python programming with machine learning fundamental and theoretical principles.

  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

An Introduction to Python Programming: A Practical Approach

step-by-step approach to Python programming with machine learning fundamental and theoretical principles.

About this book

step-by-step approach to Python programming with machine learning fundamental and theoretical principles.

Key Features
? Introduces readers to Python programming in a very simple way.
? Extensive practical demonstration of Python concepts using numerous examples.
? Implementation of machine learning in Python using hands-on techniques.

Description
The book 'Introduction to Python Programming: A Practical Approach' lays out a path for readers who want to pursue a career in the field of computer software development. It covers the fundamentals of Python programming as well as machine learning principles. Students will benefit from the examples that are included with each concept, which will aid them in understanding the concept.This book provides a practical understanding of Python programming using numerous programs and examples. It also develops problem-solving and code-writing abilities for the readers. This book covers Python fundamentals, operators, and data structures such as strings, lists, dictionaries, and tuples. It also contains information on file and exception handling. The implementation of a machine learning model has also been included in this book.With the help of this book, students and programmers can improve their programming skills as well as their ability to sprint towards a rewarding career.

What you will learn
? Learn Python concepts, operators, and data structures.
? Learn the properties and operations of lists, tuples, and dictionaries.
? Write Python code to solve specific issues.
? Write Python code to handle disk files and exceptions.
? Work with OOPS properties like classes, objects, constructors, inheritance, and polymorphism.

Who this book is for
This book is intended for current and aspiring emerging technology professionals, students, and anyone else who wishes to better understand the Python programming language and machine learning concepts.

Table of Contents
1. Chapter 1: Basics of Python Programming
2. Chapter 2: Operators and Expressions
3. Chapter 3: Control Flow Statements
4. Chapter 4: Functions
5. Chapter 5: Strings
6. Chapter 6: Lists
7. Chapter 7: Tuple
8. Chapter 8: Dictionaries
9. Chapter 9: File Handling
10. Chapter 10: Exception Handling, Modules, and Packages
11. Chapter 11: Object-oriented Programming
12. Chapter 12: Machine Learning with Python
13. Chapter 13: Clustering with Python

About the Authors
Dr. Krishna Kumar Mohbey is an assistant professor of Computer Science at the Central University of Rajasthan, India. He completed his Ph.D. from the Department of Mathematics and Computer Applications from the National Institute of Technology Bhopal, India (2015). His areas of interest are machine learning, data mining, mobile web services, big data analysis, and user behavior analysis. He has authored three books on different subjects and published more than 25 research articles in reputed journals and conferences. LinkedIn Profile: https://in.linkedin.com/in/dr-k-k-mohbey-78947448 Dr. Brijesh Bakariya is working as an assistant professor for the Department of Computer Science and Engineering, I.K. Gujral Punjab Technical University (IKGPTU) Jalandhar (Punjab). He completed his Ph.D. degree from Maulana Azad National Institute of Technology (NIT- Bhopal), Madhya Pradesh (2016). He has authored 01 books and published more than 15 research papers in the journals of international repute in areas of data mining, image processing, machine learning, etc. LinkedIn Profile: https://www.linkedin.com/in/brijesh-bakariya-72b0237a

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, weโ€™ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere โ€” even offline. Perfect for commutes or when youโ€™re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access An Introduction to Python Programming: A Practical Approach by Dr. Krishna Kumar Mohbey; Dr. Brijesh Bakariya in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in Python. We have over one million books available in our catalogue for you to explore.

CHAPTER 1

Basics of Python Programming

Nowadays, Python is one of the most popular programming languages. There are many reasons for this, but simply it is easy to read and write Python code. Python provides vast libraries for which you can efficiently make your program. In this chapter, you will see various features, installation, and the making of a simple program of Python.

Structure

In this chapter, we will cover the following topics:
  • Basic features and history of Python
  • Installing Python and running Python program to IDE
  • Writing and executing first Python program
  • Brief description about various concepts used in Python

Objective

The objective of this chapter is to introduce the concept of Python, its features, and the Installation procedure in Windows and Linux. After completing this chapter, you should be familiar with Python IDE and editors. Also, you will be able to write simple Python programs.

Understanding Python

Python is one of the high-level languages. There are various advantages of high-level languages:
  • Program is easier and understandable which is written in a high-level language
  • Program is shorter in a high-level language
  • The code written in a high-level language is portable, which means it can run on different computers with some modifications.
Due to these preceding advantages, almost all programs are written in high-level languages. Guido van Rossum designed Python in 1991; after that, Python released various versions as shown in table 1.1:
Python Version
Released Year
3.9
2020
3.8
2019
3.7
2018
3.6
2016
2.7
2010
Table 1.1: Python versions with released year
The compiler completes the task which is involved in the compilation process. Moreover, it converts a source code to object code, and after that, the program will be converted to machine understandable code. But an interpreter reads a high-level program and executes it. Python does not follow the compilation process; it is used only as an interpreter. That's why from a computation point of view, Python is very fast. The figures can easily understand it.
Here figure 1.1 shows the structure of the compiler. A compiler translates source code into an object code, which a hardware executor runs:
Figure 1.1: Structure of Compiler
Here figure 1.2, shows the structure of the interpreter. An interpreter processes the program in less time, and it also takes less time to read lines and perform computations:
Figure 1.2: Structure of Interpreter
Python is an interpreted language because an interpreter executes Python programs, but the compilation process is also done in Python. The compilation part is hidden from the programmer that is why it is known as an interpreted language.
There are various reasons Python has become more popular:
  • It is easy to use because its coding is written in a simple English language. Users can easily understand and write code into Python, so it takes less time to write a program.
  • It is a very powerful language because it has many libraries where you can easily make a program. An inbuilt library has lots of inbuilt functions where you can insert as per your need.
  • It is an object-oriented programming language that is why it follows all the object-oriented concepts.
  • It is integrated with other programming languages such as C, C++, Java, etc.
  • It is platform-independent, which means if you created a program in one operating system, you could also run that program in another operating system.
  • It is free and open-source, which means you can install it on your computer without any cost. It can be copied or modifie...

Table of contents

  1. Cover Page
  2. Title Page
  3. Copyright Page
  4. Dedication Page
  5. About the Authors
  6. About the Reviewer
  7. Acknowledgement
  8. Preface
  9. Errata
  10. Table of Contents
  11. 1. Basics of Python Programming
  12. 2. Operators and Expressions
  13. 3. Control Flow Statements
  14. 4. Functions
  15. 5. Strings
  16. 6. Lists
  17. 7. Tuple
  18. 8. Dictionaries
  19. 9. File Handling
  20. 10. Exception Handling, Modules, and Packages
  21. 11. Object-oriented Programming
  22. 12. Machine Learning with Python
  23. 13. Clustering with Python
  24. Index