Seite - 3 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Band Second Edition
Bild der Seite - 3 -
Text der Seite - 3 -
1.1 What IsaProgram?AndWhat IsProgramming? 3
do? Well, you may write down the recipe in those three languages and send them
over. Now, if you have been able to think correctly when writing down the recipe,
andyouhavewritten theexplanationsaccordingto the rules ineach language,each
ofyourfriendswillproducethesamecake.Yourrecipe is the“computerprogram”,
while English, Russian and Chinese represent the “computer languages” with their
own rules of how to write things. The end product, though, is still the same cake.
Note that you may unintentionally introduce errors in your “recipe”. Depending
on the error, this may cause “baking execution” to stop, or perhaps produce the
wrong cake. In your computer program, the errors you introduce are called bugs
(yes,small insects! ...forhistoricalreasons),andtheprocessoffixingthemiscalled
debugging.When you try to run yourprogramthat containserrors, you usually get
warningsorerrormessages.However,theresponseyougetdependsontheerrorand
the programming language. You may even get no response, but simply the wrong
“cake”. Note that the rules of a programming language have to be followed very
strictly. This differs from languages like English etc., where the meaning might be
understoodevenwith spellingerrorsand“slang” included.
We Use Python 3.6 in This Book For good reasons, the programming language
used in this book is Python (version 3.6). It is an excellent language for beginners
(and experts!), with a simple and clear syntax. Some of Python’s other strong
properties are1: It has a huge and excellent library (i.e., ready-made pieces of
code that you can utilize for certain tasks in your own programs), many global
functionscan be placed in onlyone file, functionsare straightforwardly transferred
as arguments to other functions, there is good support for interfacing C, C++ and
Fortrancode (i.e., a Pythonprogrammayuse code written in other languages),and
functions explicitly written for scalar input often work fine, without modification,
also with vector input.Another important thing, is that Python is available for free.
It canbedownloadedatnocost fromthe Internetandwill runonmostplatforms.
APrimer onScientific Programmingwith Python
Readers who want to expand their scientific programming skills beyond the
introductorylevelof thepresentexposition,areencouragedtostudyAPrimer
on Scientific Programming with Python [11]. This comprehensive book is
as suitable for beginners as for professional programmers, and teaches the
art of programming through a huge collection of dedicated examples. This
book is considered the primary reference, and a natural extension, of the
programmingmatters in the present book. Note, however, that this reference
[11]usesversion2.7ofPython,whichmeansthat, ina fewcases, instructions
will differ somewhat fromwhatyoufindin thepresentbook.
1 Some of the words here will be new to you, but relax, they will all be explained as we move
along.
Programming for Computations – Python
A Gentle Introduction to Numerical Simulations with Python 3.6, Band Second Edition
- Titel
- Programming for Computations – Python
- Untertitel
- A Gentle Introduction to Numerical Simulations with Python 3.6
- Band
- Second Edition
- Autoren
- Svein Linge
- Hans Petter Langtangen
- Verlag
- Springer Open
- Datum
- 2020
- Sprache
- englisch
- Lizenz
- CC BY 4.0
- ISBN
- 978-3-319-32428-9
- Abmessungen
- 17.8 x 25.4 cm
- Seiten
- 356
- Schlagwörter
- Programmiersprache, Informatik, programming language, functional, imperative, object-oriented, reflective
- Kategorie
- Informatik