In [1]:
'Hello world!'


Out[1]:
'Hello world!'

In [3]:
t = 'Hello, world!'

In [4]:
t


Out[4]:
'Hello, world!'

In [5]:
print t


Hello, world!

In [6]:
6**4


Out[6]:
1296

In [7]:
100/12


Out[7]:
8

In [8]:
100./12


Out[8]:
8.333333333333334

In [9]:
round(100./12, 3)


Out[9]:
8.333

In [10]:
from math import factorial

In [11]:
factorial(3)


Out[11]:
6

In [13]:
factorial(10) * 0.5


Out[13]:
1814400.0

text

Header

$$ c = \sqrt{a^2 + b^2}$$

In [14]:
! echo 'hello, world!'


hello, world!

In [15]:
! echo $t


Hello, world!

In [18]:
%%bash
ls


introduction_in_ipython.py.ipynb

In [19]:
%lsmagic


Out[19]:
Available line magics:
%alias  %alias_magic  %autocall  %automagic  %autosave  %bookmark  %cat  %cd  %clear  %colors  %config  %connect_info  %cp  %debug  %dhist  %dirs  %doctest_mode  %ed  %edit  %env  %gui  %hist  %history  %install_default_config  %install_ext  %install_profiles  %killbgscripts  %ldir  %less  %lf  %lk  %ll  %load  %load_ext  %loadpy  %logoff  %logon  %logstart  %logstate  %logstop  %ls  %lsmagic  %lx  %macro  %magic  %man  %matplotlib  %mkdir  %more  %mv  %notebook  %page  %pastebin  %pdb  %pdef  %pdoc  %pfile  %pinfo  %pinfo2  %popd  %pprint  %precision  %profile  %prun  %psearch  %psource  %pushd  %pwd  %pycat  %pylab  %qtconsole  %quickref  %recall  %rehashx  %reload_ext  %rep  %rerun  %reset  %reset_selective  %rm  %rmdir  %run  %save  %sc  %set_env  %store  %sx  %system  %tb  %time  %timeit  %unalias  %unload_ext  %who  %who_ls  %whos  %xdel  %xmode

Available cell magics:
%%!  %%HTML  %%SVG  %%bash  %%capture  %%debug  %%file  %%html  %%javascript  %%latex  %%perl  %%prun  %%pypy  %%python  %%python2  %%python3  %%ruby  %%script  %%sh  %%svg  %%sx  %%system  %%time  %%timeit  %%writefile

Automagic is ON, % prefix IS NOT needed for line magics.

In [22]:
%pylab inline


Populating the interactive namespace from numpy and matplotlib

In [25]:
y = range(11)

In [26]:
y


Out[26]:
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

In [27]:
plot(y)


Out[27]:
[<matplotlib.lines.Line2D at 0x7f53dd4e9990>]