In [1]:
print "hello world!"
# Python 2 engine.
hello world!
In [2]:
print("hello world, pyton 2 format")
# Test python 2 format.
hello world, pyton 2 format
In [3]:
# Both Python 2 and Python 3 recognized in Jupyter notebook. Kernel selection specifies Python 2 or 3.
In [4]:
3+5
Out[4]:
8
In [5]:
x = 3 ** 3
In [6]:
print("x=", x)
('x=', 27)
In [7]:
x
Out[7]:
27
In [8]:
print(In)
['', u'print "hello world!"\n# Python 2 engine.', u'print("hello world, pyton 2 format")\n# Test python 2 format.', u'# Both Python 2 and Python 3 recognized in Jupyter notebook. Kernel selection specifies Python 2 or 3.', u'3+5', u'x = 3 ** 3', u'print("x=", x)', u'x', u'print(In)']
In [9]:
print(Out)
{4: 8, 7: 27}
In [10]:
print(_)
27
In [11]:
print(__)
8
In [12]:
%history 1-8
print "hello world!"
# Python 2 engine.
print("hello world, pyton 2 format")
# Test python 2 format.
# Both Python 2 and Python 3 recognized in Jupyter notebook. Kernel selection specifies Python 2 or 3.
3+5
x = 3 ** 3
print("x=", x)
x
print(In)
In [13]:
%save myhist1.py %history 1-8
File `myhist1.py` exists. Overwrite (y/[N])?  y
The following commands were written to file `myhist1.py`:
print "hello world!"
# Python 2 engine.
print("hello world, pyton 2 format")
# Test python 2 format.
# Both Python 2 and Python 3 recognized in Jupyter notebook. Kernel selection specifies Python 2 or 3.
3+5
x = 3 ** 3
print("x=", x)
x
print(In)
In [14]:
%save myout1.py str(Out)
The following commands were written to file `myout1.py`:
{4: 8, 7: 27}
In [ ]:
 
In [ ]:
 
In [ ]:
 
In [ ]: