Free and open-source software, with vibrant community
Extensible: add new built-in modules to Python (written in C)
Text
# Python 2 only:
print 'Hello'
# Python 2 and 3:
print('Hello')
# Python 2 only:
print 'Hello', 'World'
# Python 2 and 3:
from __future__ import print_function
print('Hello', 'World')
# Python 2 only:
assert 2 / 3 == 0
# Python 2 and 3:
assert 2 // 3 == 0
# Python 3 only:
assert 3 / 2 == 1.5
# Python 2 and 3:
from __future__ import division # (at top of module)
assert 3 / 2 == 1.5
pip install -U numpy, scipy, ipython, matplotlib, pandas, scikit-learn
s = 'Hello World!'
print(s)
$ ipython hello_world.py
$ ipython
In [1]: %run hello_world.py
In [2]: s
In [3]: i = 2
In [4]: s2 = 'Hi'
In [5]: s+s2
Start Jupyter Notebook:
$ jupyter notebook
More about Jupyter Notebooks... in this Jupyter Notebook
Tip: Try cloning or downloading it and then opening it.
Run and modify its code cells.
Read and test for yourself the examples provided in:
The SciPy Lectures -- The Python Language
Tip: Practice those examples using alternatively python files, the IPython interpreter and a Jupyter Notebook.