##// END OF EJS Templates
print is a function in Python 3
Julia Evans -
Show More
@@ -1,46 +1,46 b''
1 {
1 {
2 "metadata": {
2 "metadata": {
3 "name": ""
3 "name": ""
4 },
4 },
5 "nbformat": 3,
5 "nbformat": 3,
6 "nbformat_minor": 0,
6 "nbformat_minor": 0,
7 "worksheets": [
7 "worksheets": [
8 {
8 {
9 "cells": [
9 "cells": [
10 {
10 {
11 "cell_type": "code",
11 "cell_type": "code",
12 "collapsed": false,
12 "collapsed": false,
13 "input": [
13 "input": [
14 "from IPython.display import clear_output"
14 "from IPython.display import clear_output"
15 ],
15 ],
16 "language": "python",
16 "language": "python",
17 "metadata": {},
17 "metadata": {},
18 "outputs": [],
18 "outputs": [],
19 "prompt_number": 1
19 "prompt_number": 1
20 },
20 },
21 {
21 {
22 "cell_type": "code",
22 "cell_type": "code",
23 "collapsed": false,
23 "collapsed": false,
24 "input": [
24 "input": [
25 "for i in range(10):\n",
25 "for i in range(10):\n",
26 " clear_output()\n",
26 " clear_output()\n",
27 " print i"
27 " print(i)"
28 ],
28 ],
29 "language": "python",
29 "language": "python",
30 "metadata": {},
30 "metadata": {},
31 "outputs": [
31 "outputs": [
32 {
32 {
33 "output_type": "stream",
33 "output_type": "stream",
34 "stream": "stdout",
34 "stream": "stdout",
35 "text": [
35 "text": [
36 "9\n"
36 "9\n"
37 ]
37 ]
38 }
38 }
39 ],
39 ],
40 "prompt_number": 2
40 "prompt_number": 2
41 }
41 }
42 ],
42 ],
43 "metadata": {}
43 "metadata": {}
44 }
44 }
45 ]
45 ]
46 } No newline at end of file
46 }
@@ -1,55 +1,55 b''
1 {
1 {
2 "metadata": {
2 "metadata": {
3 "name": ""
3 "name": ""
4 },
4 },
5 "nbformat": 3,
5 "nbformat": 3,
6 "nbformat_minor": 0,
6 "nbformat_minor": 0,
7 "worksheets": [
7 "worksheets": [
8 {
8 {
9 "cells": [
9 "cells": [
10 {
10 {
11 "cell_type": "code",
11 "cell_type": "code",
12 "collapsed": false,
12 "collapsed": false,
13 "input": [
13 "input": [
14 "i, j = 1, 1"
14 "i, j = 1, 1"
15 ],
15 ],
16 "language": "python",
16 "language": "python",
17 "metadata": {},
17 "metadata": {},
18 "outputs": [],
18 "outputs": [],
19 "prompt_number": 1
19 "prompt_number": 1
20 },
20 },
21 {
21 {
22 "cell_type": "code",
22 "cell_type": "code",
23 "collapsed": false,
23 "collapsed": false,
24 "input": [
24 "input": [
25 "for m in range(10):\n",
25 "for m in range(10):\n",
26 " i, j = j, i + j\n",
26 " i, j = j, i + j\n",
27 " print j"
27 " print(j)"
28 ],
28 ],
29 "language": "python",
29 "language": "python",
30 "metadata": {},
30 "metadata": {},
31 "outputs": [
31 "outputs": [
32 {
32 {
33 "output_type": "stream",
33 "output_type": "stream",
34 "stream": "stdout",
34 "stream": "stdout",
35 "text": [
35 "text": [
36 "2\n",
36 "2\n",
37 "3\n",
37 "3\n",
38 "5\n",
38 "5\n",
39 "8\n",
39 "8\n",
40 "13\n",
40 "13\n",
41 "21\n",
41 "21\n",
42 "34\n",
42 "34\n",
43 "55\n",
43 "55\n",
44 "89\n",
44 "89\n",
45 "144\n"
45 "144\n"
46 ]
46 ]
47 }
47 }
48 ],
48 ],
49 "prompt_number": 2
49 "prompt_number": 2
50 }
50 }
51 ],
51 ],
52 "metadata": {}
52 "metadata": {}
53 }
53 }
54 ]
54 ]
55 } No newline at end of file
55 }
@@ -1,33 +1,33 b''
1 {
1 {
2 "metadata": {
2 "metadata": {
3 "name": ""
3 "name": ""
4 },
4 },
5 "nbformat": 3,
5 "nbformat": 3,
6 "nbformat_minor": 0,
6 "nbformat_minor": 0,
7 "worksheets": [
7 "worksheets": [
8 {
8 {
9 "cells": [
9 "cells": [
10 {
10 {
11 "cell_type": "code",
11 "cell_type": "code",
12 "collapsed": false,
12 "collapsed": false,
13 "input": [
13 "input": [
14 "print \"Hello World\""
14 "print(\"Hello World\")"
15 ],
15 ],
16 "language": "python",
16 "language": "python",
17 "metadata": {},
17 "metadata": {},
18 "outputs": [
18 "outputs": [
19 {
19 {
20 "output_type": "stream",
20 "output_type": "stream",
21 "stream": "stdout",
21 "stream": "stdout",
22 "text": [
22 "text": [
23 "Hello World\n"
23 "Hello World\n"
24 ]
24 ]
25 }
25 }
26 ],
26 ],
27 "prompt_number": 1
27 "prompt_number": 1
28 }
28 }
29 ],
29 ],
30 "metadata": {}
30 "metadata": {}
31 }
31 }
32 ]
32 ]
33 } No newline at end of file
33 }
@@ -1,55 +1,55 b''
1 {
1 {
2 "metadata": {
2 "metadata": {
3 "name": ""
3 "name": ""
4 },
4 },
5 "nbformat": 3,
5 "nbformat": 3,
6 "nbformat_minor": 0,
6 "nbformat_minor": 0,
7 "worksheets": [
7 "worksheets": [
8 {
8 {
9 "cells": [
9 "cells": [
10 {
10 {
11 "cell_type": "code",
11 "cell_type": "code",
12 "collapsed": false,
12 "collapsed": false,
13 "input": [
13 "input": [
14 "1 / 0"
14 "1 / 0"
15 ],
15 ],
16 "language": "python",
16 "language": "python",
17 "metadata": {},
17 "metadata": {},
18 "outputs": [
18 "outputs": [
19 {
19 {
20 "ename": "ZeroDivisionError",
20 "ename": "ZeroDivisionError",
21 "evalue": "integer division or modulo by zero",
21 "evalue": "integer division or modulo by zero",
22 "output_type": "pyerr",
22 "output_type": "pyerr",
23 "traceback": [
23 "traceback": [
24 "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mZeroDivisionError\u001b[0m Traceback (most recent call last)",
24 "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mZeroDivisionError\u001b[0m Traceback (most recent call last)",
25 "\u001b[1;32m<ipython-input-1-b710d87c980c>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;36m1\u001b[0m \u001b[1;33m/\u001b[0m \u001b[1;36m0\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
25 "\u001b[1;32m<ipython-input-1-b710d87c980c>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;36m1\u001b[0m \u001b[1;33m/\u001b[0m \u001b[1;36m0\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
26 "\u001b[1;31mZeroDivisionError\u001b[0m: integer division or modulo by zero"
26 "\u001b[1;31mZeroDivisionError\u001b[0m: integer division or modulo by zero"
27 ]
27 ]
28 }
28 }
29 ],
29 ],
30 "prompt_number": 1
30 "prompt_number": 1
31 },
31 },
32 {
32 {
33 "cell_type": "code",
33 "cell_type": "code",
34 "collapsed": false,
34 "collapsed": false,
35 "input": [
35 "input": [
36 "print 'ok'"
36 "print('ok')"
37 ],
37 ],
38 "language": "python",
38 "language": "python",
39 "metadata": {},
39 "metadata": {},
40 "outputs": [
40 "outputs": [
41 {
41 {
42 "output_type": "stream",
42 "output_type": "stream",
43 "stream": "stdout",
43 "stream": "stdout",
44 "text": [
44 "text": [
45 "ok\n"
45 "ok\n"
46 ]
46 ]
47 }
47 }
48 ],
48 ],
49 "prompt_number": 2
49 "prompt_number": 2
50 }
50 }
51 ],
51 ],
52 "metadata": {}
52 "metadata": {}
53 }
53 }
54 ]
54 ]
55 } No newline at end of file
55 }
@@ -1,33 +1,33 b''
1 {
1 {
2 "metadata": {
2 "metadata": {
3 "name": ""
3 "name": ""
4 },
4 },
5 "nbformat": 3,
5 "nbformat": 3,
6 "nbformat_minor": 0,
6 "nbformat_minor": 0,
7 "worksheets": [
7 "worksheets": [
8 {
8 {
9 "cells": [
9 "cells": [
10 {
10 {
11 "cell_type": "code",
11 "cell_type": "code",
12 "collapsed": false,
12 "collapsed": false,
13 "input": [
13 "input": [
14 "print '\u2603'"
14 "print('\u2603')"
15 ],
15 ],
16 "language": "python",
16 "language": "python",
17 "metadata": {},
17 "metadata": {},
18 "outputs": [
18 "outputs": [
19 {
19 {
20 "output_type": "stream",
20 "output_type": "stream",
21 "stream": "stdout",
21 "stream": "stdout",
22 "text": [
22 "text": [
23 "\u2603\n"
23 "\u2603\n"
24 ]
24 ]
25 }
25 }
26 ],
26 ],
27 "prompt_number": 1
27 "prompt_number": 1
28 }
28 }
29 ],
29 ],
30 "metadata": {}
30 "metadata": {}
31 }
31 }
32 ]
32 ]
33 } No newline at end of file
33 }
@@ -1,36 +1,36 b''
1 {
1 {
2 "metadata": {
2 "metadata": {
3 "name": ""
3 "name": ""
4 },
4 },
5 "nbformat": 3,
5 "nbformat": 3,
6 "nbformat_minor": 0,
6 "nbformat_minor": 0,
7 "worksheets": [
7 "worksheets": [
8 {
8 {
9 "cells": [
9 "cells": [
10 {
10 {
11 "cell_type": "code",
11 "cell_type": "code",
12 "collapsed": false,
12 "collapsed": false,
13 "input": [
13 "input": [
14 "from IPython.display import clear_output"
14 "from IPython.display import clear_output"
15 ],
15 ],
16 "language": "python",
16 "language": "python",
17 "metadata": {},
17 "metadata": {},
18 "outputs": []
18 "outputs": []
19 },
19 },
20 {
20 {
21 "cell_type": "code",
21 "cell_type": "code",
22 "collapsed": false,
22 "collapsed": false,
23 "input": [
23 "input": [
24 "for i in range(10):\n",
24 "for i in range(10):\n",
25 " clear_output()\n",
25 " clear_output()\n",
26 " print i"
26 " print(i)"
27 ],
27 ],
28 "language": "python",
28 "language": "python",
29 "metadata": {},
29 "metadata": {},
30 "outputs": []
30 "outputs": []
31 }
31 }
32 ],
32 ],
33 "metadata": {}
33 "metadata": {}
34 }
34 }
35 ]
35 ]
36 } No newline at end of file
36 }
@@ -1,36 +1,36 b''
1 {
1 {
2 "metadata": {
2 "metadata": {
3 "name": ""
3 "name": ""
4 },
4 },
5 "nbformat": 3,
5 "nbformat": 3,
6 "nbformat_minor": 0,
6 "nbformat_minor": 0,
7 "worksheets": [
7 "worksheets": [
8 {
8 {
9 "cells": [
9 "cells": [
10 {
10 {
11 "cell_type": "code",
11 "cell_type": "code",
12 "collapsed": false,
12 "collapsed": false,
13 "input": [
13 "input": [
14 "i, j = 1, 1"
14 "i, j = 1, 1"
15 ],
15 ],
16 "language": "python",
16 "language": "python",
17 "metadata": {},
17 "metadata": {},
18 "outputs": []
18 "outputs": []
19 },
19 },
20 {
20 {
21 "cell_type": "code",
21 "cell_type": "code",
22 "collapsed": false,
22 "collapsed": false,
23 "input": [
23 "input": [
24 "for m in range(10):\n",
24 "for m in range(10):\n",
25 " i, j = j, i + j\n",
25 " i, j = j, i + j\n",
26 " print j"
26 " print(j)"
27 ],
27 ],
28 "language": "python",
28 "language": "python",
29 "metadata": {},
29 "metadata": {},
30 "outputs": []
30 "outputs": []
31 }
31 }
32 ],
32 ],
33 "metadata": {}
33 "metadata": {}
34 }
34 }
35 ]
35 ]
36 } No newline at end of file
36 }
@@ -1,24 +1,24 b''
1 {
1 {
2 "metadata": {
2 "metadata": {
3 "name": ""
3 "name": ""
4 },
4 },
5 "nbformat": 3,
5 "nbformat": 3,
6 "nbformat_minor": 0,
6 "nbformat_minor": 0,
7 "worksheets": [
7 "worksheets": [
8 {
8 {
9 "cells": [
9 "cells": [
10 {
10 {
11 "cell_type": "code",
11 "cell_type": "code",
12 "collapsed": false,
12 "collapsed": false,
13 "input": [
13 "input": [
14 "print \"Hello World\""
14 "print(\"Hello World\")"
15 ],
15 ],
16 "language": "python",
16 "language": "python",
17 "metadata": {},
17 "metadata": {},
18 "outputs": []
18 "outputs": []
19 }
19 }
20 ],
20 ],
21 "metadata": {}
21 "metadata": {}
22 }
22 }
23 ]
23 ]
24 } No newline at end of file
24 }
@@ -1,55 +1,55 b''
1 {
1 {
2 "metadata": {
2 "metadata": {
3 "name": ""
3 "name": ""
4 },
4 },
5 "nbformat": 3,
5 "nbformat": 3,
6 "nbformat_minor": 0,
6 "nbformat_minor": 0,
7 "worksheets": [
7 "worksheets": [
8 {
8 {
9 "cells": [
9 "cells": [
10 {
10 {
11 "cell_type": "code",
11 "cell_type": "code",
12 "collapsed": false,
12 "collapsed": false,
13 "input": [
13 "input": [
14 "1 / 0"
14 "1 / 0"
15 ],
15 ],
16 "language": "python",
16 "language": "python",
17 "metadata": {},
17 "metadata": {},
18 "outputs": [
18 "outputs": [
19 {
19 {
20 "ename": "ZeroDivisionError",
20 "ename": "ZeroDivisionError",
21 "evalue": "integer division or modulo by zero",
21 "evalue": "integer division or modulo by zero",
22 "output_type": "pyerr",
22 "output_type": "pyerr",
23 "traceback": [
23 "traceback": [
24 "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mZeroDivisionError\u001b[0m Traceback (most recent call last)",
24 "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mZeroDivisionError\u001b[0m Traceback (most recent call last)",
25 "\u001b[1;32m<ipython-input-1-b710d87c980c>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;36m1\u001b[0m \u001b[1;33m/\u001b[0m \u001b[1;36m0\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
25 "\u001b[1;32m<ipython-input-1-b710d87c980c>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;36m1\u001b[0m \u001b[1;33m/\u001b[0m \u001b[1;36m0\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
26 "\u001b[1;31mZeroDivisionError\u001b[0m: integer division or modulo by zero"
26 "\u001b[1;31mZeroDivisionError\u001b[0m: integer division or modulo by zero"
27 ]
27 ]
28 }
28 }
29 ],
29 ],
30 "prompt_number": 1
30 "prompt_number": 1
31 },
31 },
32 {
32 {
33 "cell_type": "code",
33 "cell_type": "code",
34 "collapsed": false,
34 "collapsed": false,
35 "input": [
35 "input": [
36 "print 'ok'"
36 "print('ok')"
37 ],
37 ],
38 "language": "python",
38 "language": "python",
39 "metadata": {},
39 "metadata": {},
40 "outputs": [
40 "outputs": [
41 {
41 {
42 "output_type": "stream",
42 "output_type": "stream",
43 "stream": "stdout",
43 "stream": "stdout",
44 "text": [
44 "text": [
45 "ok\n"
45 "ok\n"
46 ]
46 ]
47 }
47 }
48 ],
48 ],
49 "prompt_number": 2
49 "prompt_number": 2
50 }
50 }
51 ],
51 ],
52 "metadata": {}
52 "metadata": {}
53 }
53 }
54 ]
54 ]
55 } No newline at end of file
55 }
@@ -1,24 +1,24 b''
1 {
1 {
2 "metadata": {
2 "metadata": {
3 "name": ""
3 "name": ""
4 },
4 },
5 "nbformat": 3,
5 "nbformat": 3,
6 "nbformat_minor": 0,
6 "nbformat_minor": 0,
7 "worksheets": [
7 "worksheets": [
8 {
8 {
9 "cells": [
9 "cells": [
10 {
10 {
11 "cell_type": "code",
11 "cell_type": "code",
12 "collapsed": false,
12 "collapsed": false,
13 "input": [
13 "input": [
14 "print '\u2603'"
14 "print('\u2603')"
15 ],
15 ],
16 "language": "python",
16 "language": "python",
17 "metadata": {},
17 "metadata": {},
18 "outputs": []
18 "outputs": []
19 }
19 }
20 ],
20 ],
21 "metadata": {}
21 "metadata": {}
22 }
22 }
23 ]
23 ]
24 } No newline at end of file
24 }
General Comments 0
You need to be logged in to leave comments. Login now