Book Image

Scientific Computing with Python 3

By : Claus Führer, Jan Erik Solem, Olivier Verdier
Book Image

Scientific Computing with Python 3

By: Claus Führer, Jan Erik Solem, Olivier Verdier

Overview of this book

Python can be used for more than just general-purpose programming. It is a free, open source language and environment that has tremendous potential for use within the domain of scientific computing. This book presents Python in tight connection with mathematical applications and demonstrates how to use various concepts in Python for computing purposes, including examples with the latest version of Python 3. Python is an effective tool to use when coupling scientific computing and mathematics and this book will teach you how to use it for linear algebra, arrays, plotting, iterating, functions, polynomials, and much more.
Table of Contents (23 chapters)
Scientific Computing with Python 3
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Acknowledgement
Preface
References

Variables


Variables are references to Python objects. They are created by assignments, for example:

a = 1 
diameter = 3.
height = 5.
cylinder = [diameter, height] # reference to a list

Variables take names that consist of any combination of capital and small letters, the underscore _ , and digits. A variable name must not start with a digit. Note that variable names are case sensitive. A good naming of variables is an essential part of documenting your work, so we recommend that you use descriptive variable names.

Python has some reserved keywords, which cannot be used as variable names (refer to following table, Table 2.1). An attempt to use such a keyword as variable name would raise a syntax error.

Table 2.1: Reserved Python keywords.

As opposed to other programming languages, variables require no type declaration. You can create several variables with a multiple assignment statement:

a = b = c = 1   # a, b and c get the same value 1

Variables can also be altered after their...