PYTHON
BASICSLICENSE, DISCLAIMER OF LIABILITY, AND LIMITED WARRANTYBy purchasing or using this book (the Work), you agree that this license grants permission to use the contents contained herein, but does not give you the right of ownership to any of the textual content in the book or ownership to any of the information or products contained in it. This license does not permit uploading of the Work onto the Internet or on a network (of any kind) without the written consent of the Publisher. Duplication or dissemination of any text, code, simulations, images, etc., contained herein is limited to and subject to licensing terms for the respective products, and permission must be obtained from the Publisher or the owner of the content, etc., in order to reproduce or network any portion of the textual material (in any media) that is contained in the Work.MERCURY LEARNING AND INFORMATION (MLI or the Publisher) and anyone involved in the creation, writing, production, accompanying algorithms, code, or computer programs (the software), and any accompanying Web site or software of the Work, cannot and do not warrant the performance or results that might be obtained by using the contents of the Work. The author, developers, and the Publisher have used their best efforts to insure the accuracy and functionality of the textual material and/or programs contained in this package; we, however, make no warranty of any kind, express or implied, regarding the performance of these contents or programs. The Work is sold as is without warranty (except for defective materials used in manufacturing the book or due to faulty workmanship).The author, developers, and the publisher of any accompanying content, and anyone involved in the composition, production, and manufacturing of this work will not be liable for damages of any kind arising out of the use of (or the inability to use) the algorithms, source code, computer programs, or textual material contained in this publication. This includes, but is not limited to, loss of revenue or profit, or other incidental, physical, or consequential damages arising out of the use of this Work.The sole remedy in the event of a claim of any kind is expressly limited to replacement of the book and only at the discretion of the Publisher.
The use of implied warranty and certain exclusions vary from state to state, and might not apply to the purchaser of this product.PYTHON
BASICSH. BhasinMERCURY LEARNING AND INFORMATIONDulles, Virginia
Boston, Massachusetts
New DelhiCopyright 2019 by MERCURY LEARNING AND INFORMATION LLC. All rights reserved.
ISBN: 978-1-683923-53-4. Reprinted and revised with permission.Original Title and Copyright: Python for Beginners.
Copyright 2019 by New Age International (P) Ltd. Publishers. Bhasin. Python Basics.
ISBN: 978-1-683923-53-4The publisher recognizes and respects all marks used by companies, manufacturers, and developers as a means to distinguish their products. Python Basics.
ISBN: 978-1-683923-53-4The publisher recognizes and respects all marks used by companies, manufacturers, and developers as a means to distinguish their products.
All brand names and product names mentioned in this book are trademarks or service marks of their respective companies. Any omission or misuse (of any kind) of service marks or trademarks, etc. is not an attempt to infringe on the property of others.Library of Congress Control Number: 2018962670181920321 Printed on acid-free paper in the United States of America.Our titles are available for adoption, license, or bulk purchase by institutions, corporations, etc. For additional information, please contact the Customer Service Dept. at 800-232-0223(toll free).All of our titles are available in digital format at authorcloudware.com and other digital vendors. The sole obligation of MERCURY LEARNING AND INFORMATION to the purchaser is to replace the book, based on defective materials or faulty workmanship, but not based on the operation or functionality of the product.To
My MotherCONTENTSCHAPTER 1INTRODUCTION TO PYTHONAfter reading this chapter, the reader will be able toUnderstand the chronology of PythonAppreciate the importance and features of PythonDiscover the areas in which Python can be usedInstall Anaconda1.1 INTRODUCTIONArt is an expression of human creative skill, hence programming is an art.
The choice of programming language is, therefore, important. This book introduces Python, which will help you to become a great artist. A. J. Perlis, who was a professor at the Purdue University, and who was the recipient of the first Turing award, statedA language that doesnt affect the way you think about programming is not worth knowing.Python is worth knowing. Learning Python will not only motivate you to do highly complex tasks in the simplest manners but will also demolish the myths of conventional programming paradigms.
It is a language which will change the way you program and hence look at a problem.Python is a strong, procedural, object-oriented, functional language crafted in the late 1980s by Guido Van Rossum. The language is named after Monty Python, a comedy group. The language is currently being used in diverse application domains. These include software development, web development, Desktop GUI development, education, and scientific applications. So, it spans almost all the facets of development. Its popularity is primarily owing to its simplicity and robustness, though there are many other factors too which are discussed in the chapters that follow.There are many third party modules for accomplishing the above tasks.
For example Django, an immensely popular Web framework dedicated to clean and fast development, is developed on Python. This, along with the support for HTML, E-mails, FTP, etc., makes it a good choice for web development.Third party libraries are also available for software development. One of the most common examples is Scions, which is used for build controls. When joined with the inbuilt features and support, Python also works miracles for GUI development and for developing mobile applications, e.g., Kivy is used for developing multi-touch applications.Python also finds its applications in scientific analysis. SciPy is used for Engineering and Mathematics, and IPython is used for parallel computing. Those of you working in statistics and machine learning would find some of these libraries extremely useful and easy to use.
SciPy provides MATLABMATLABMATLAB like features and can be used for processing multidimensional arrays. summarizes the above discussion.
Next page