Web-Books
im Austria-Forum
Austria-Forum
Web-Books
Informatik
Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Band Second Edition
Seite - 36 -
  • Benutzer
  • Version
    • Vollversion
    • Textversion
  • Sprache
    • Deutsch
    • English - Englisch

Seite - 36 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Band Second Edition

Bild der Seite - 36 -

Bild der Seite - 36 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Band Second Edition

Text der Seite - 36 -

36 1 TheFirstFewSteps run for hours, days, and even weeks. Fast code is tremendously important in those cases. The problem with a strong focus on fast code, unfortunately, is that sometimes clear and easily understandable constructions are replaced by fast (and possibly clever), but less readable code. For beginners, however, it is definitely most important to learnwriting readableandcorrect code. Wewillmakesomecommentsonconstructionsthatarefastorslow,but themain focusof thisbookis to teachhowtowritecorrectprograms,not the fastestpossible programs. 1.8.4 DeletingDataNoLongerinUse Python has automatic garbage collection, meaning that there is no need to delete variables (or objects) that are no longer in use. Python takes care of this by itself. This isopposedto,e.g.,Matlab,whereexplicitdeletingsometimesmayberequired. 1.8.5 CodeLinesThatAreTooLong If a code line in a program gets too long, it may be continued on the next line by inserting a back-slash at the end of the line before proceeding on the next line. However,noblanksmustoccurafter theback-slash!Alittledemonstrationcouldbe the following, my_sum = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 +\ 14 + 15 + 16 + 17 + 18 + 19 + 20 So, theback-slashworksasa line continuationcharacterhere. 1.8.6 WheretoFindMoreInformation? We have already recommended Langtangen’s book, A Primer on Scientific Pro- grammingwithPython (Springer,2016),as themainreferencefor thepresentbook. In addition, there is, of course, the official Python documentation website (http://docs.python.org/), which provides a Python tutorial, the Python Library Reference, a Language Reference, and more. Several other great books are also available, checkout, e.g.,http://wiki.python.org/moin/PythonBooks. Asyoudoknow,searchengineslikeGoogleareexcellentforfindinginformation quickly, so also with Python related questions! Finally, you will also find that the questions and answers at http://stackoverflow.com often cover exactly what you seek. Ifnot,youmayask yourownquestions there.
zurück zum  Buch Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Band Second Edition"
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
Web-Books
Bibliothek
Datenschutz
Impressum
Austria-Forum
Austria-Forum
Web-Books
Programming for Computations – Python