Python Introduction 2019
Python Introduction 2019
Python is a mature high-level language that is easy to learn but with many
advanced features.
“Batteries Included”: many packages and libraries available.
Python is increasingly used in physics, astronomy and data analytics
http://www.timteatro.net/2010/07/21/why-every-physicist-should-know-python/
http://bellm.org/blog/2011/05/27/why-astronomers-should-program-in-python/
Python comes with many scientific libraries (see later slide)
However Python is not perfect for everything and in cases where efficiency
and speed are needed, code is still written in C/C++ and called from
Python.
However, Python is the most generally-useful programming language for
Physics today due to the scientific modules that are available!
Python Scientific Libraries
https://docs.python.org/2.7/library/stdtypes.html#string-methods
Read from the keyboard
To read a string from the keyboard use input(‘Prompt: ‘), e.g.
break
else: