Commit 18209b24 authored by Holger Dinkel's avatar Holger Dinkel

Revert "change all printing functions to version 3; add import from future"

This reverts commit 0260a392.
parent 0260a392
......@@ -81,7 +81,6 @@
},
"outputs": [],
"source": [
"from __future__ import print_function # This statement ensures that the print function behaves the same in Python version 2 and 3\n",
"print('Hello, World')"
]
},
......@@ -769,7 +768,7 @@
},
"outputs": [],
"source": [
"print(s)"
"print s"
]
},
{
......
......@@ -35,17 +35,6 @@
"Using an editor instead of the shell allows you to quickly go back and change code that you've already written, which can make it easier to correct typos, add additional lines, and 'debug' your script to help figure out where an error or unwanted behaviour is occurring. Although you can use the command history at the shell prompt to access your previous lines of code, it is often easier to keep your scripting separate from the output. Later, we will see an example of where using an editor is really useful."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from __future__ import print_function # This statement ensures that the print function behaves the same in Python version 2 and 3"
]
},
{
"cell_type": "markdown",
"metadata": {},
......@@ -63,7 +52,7 @@
"source": [
"shopping = ['bread', 'potatoes', 'eggs', 'flour', 'rubber duck', 'pizza', 'milk']\n",
"for item in shopping:\n",
" print(item) "
" print item "
]
},
{
......@@ -400,7 +389,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"`print('I need to buy', amounts[i], shopping[i] # Python v2`)"
"`print 'I need to buy', amounts[i], shopping[i] # Python v2`"
]
},
{
......@@ -426,7 +415,7 @@
"outputs": [],
"source": [
"for i in range(len(shopping)):\n",
" print('I need to buy', amounts[i], shopping[i])"
" print 'I need to buy', amounts[i], shopping[i]"
]
},
{
......@@ -655,7 +644,7 @@
"outputs": [],
"source": [
"for item in studentNumbers:\n",
" print(item, studentNumbers[item])"
" print item, studentNumbers[item]"
]
},
{
......@@ -710,7 +699,7 @@
"outputs": [],
"source": [
"for data in studentNumbers.items():\n",
" print(data[0], data[1])"
" print data[0], data[1]"
]
},
{
......@@ -729,7 +718,7 @@
"outputs": [],
"source": [
"for course, students in studentNumbers.items():\n",
" print(course, students)"
" print course, students"
]
},
{
......
......@@ -7,17 +7,6 @@
"# Introduction to Python Programming"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from __future__ import print_function # This statement ensures that the print function behaves the same in Python version 2 and 3"
]
},
{
"cell_type": "markdown",
"metadata": {},
......@@ -127,7 +116,7 @@
"source": [
"datafile = open('speciesDistribution.txt', 'r')\n",
"for line in datafile:\n",
" print(line)"
" print line"
]
},
{
......@@ -162,7 +151,7 @@
"datafile = open('speciesDistribution.txt', 'r')\n",
"for line in datafile:\n",
" line = line.strip()\n",
" print(line)"
" print line"
]
},
{
......@@ -579,7 +568,7 @@
},
"outputs": [],
"source": [
"print(studentNumbers)"
"print studentNumbers"
]
},
{
......
......@@ -7,17 +7,6 @@
"# Introduction to Python Programming"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from __future__ import print_function # This statement ensures that the print function behaves the same in Python version 2 and 3"
]
},
{
"cell_type": "markdown",
"metadata": {},
......
......@@ -14,17 +14,6 @@
"## 5. Plotting Data with Bokeh"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from __future__ import print_function # This statement ensures that the print function behaves the same in Python version 2 and 3"
]
},
{
"cell_type": "markdown",
"metadata": {},
......@@ -597,7 +586,7 @@
},
"outputs": [],
"source": [
"print(studentNumbers)"
"print studentNumbers"
]
},
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment