Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Data Structures and Algorithms with Python - Second Edition

You're reading from  Hands-On Data Structures and Algorithms with Python - Second Edition

Product type Book
Published in Oct 2018
Publisher Packt
ISBN-13 9781788995573
Pages 398 pages
Edition 2nd Edition
Languages
Authors (2):
Dr. Basant Agarwal Dr. Basant Agarwal
Profile icon Dr. Basant Agarwal
Benjamin Baka Benjamin Baka
Profile icon Benjamin Baka
View More author details
Toc

Table of Contents (16) Chapters close

Preface 1. Python Objects, Types, and Expressions 2. Python Data Types and Structures 3. Principles of Algorithm Design 4. Lists and Pointer Structures 5. Stacks and Queues 6. Trees 7. Hashing and Symbol Tables 8. Graphs and Other Algorithms 9. Searching 10. Sorting 11. Selection Algorithms 12. String Algorithms and Techniques 13. Design Techniques and Strategies 14. Implementations, Applications, and Tools 15. Other Books You May Enjoy

Installing Python

To install Python, we use the following method.

Python is an interpreted language, and statements are executed line by line. A programmer can typically write down the series of commands in a source code file. For Python, the source code is stored in a file with a .py file extension.

Python is fully integrated and usually already installed on most of the Linux and Mac operating systems. Generally, the pre-installed Python version is 2.7. You can check the version installed on the system using the following commands:

>>> import sys
>>> print(sys.version)
3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)]

You can also install a different version of Python using the following commands on Linux:

  1. Open the Terminal
  2. sudo apt-get update
  3. sudo apt-get install -y python3-pip
  4. pip3 install <package_name>

Python has to be installed on systems with Windows operating systems, as it is not pre-installed, unlike Linux/macOS. Any version of Python can be downloaded from this link: https://www.python.org/downloads/. You can download the software installer and run it—select Install for all users and then click on Next. You need to specify the location where you want to install the package, then click Next. After that, select the option Add Python to environment variables in the Customize Python dialog box, then just click Next again for final installation. When the installation is finished, you can confirm the installation by opening up Command Prompt and typing the following command:

python -V

The latest stable Python version is Python 3.7.0. The Python program can be executed by typing the following in the command line:

python <sourcecode_filename>.py
You have been reading a chapter from
Hands-On Data Structures and Algorithms with Python - Second Edition
Published in: Oct 2018 Publisher: Packt ISBN-13: 9781788995573
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime