Fix a syntax error in print statement

pull/10/head
Tim Skov Jacobsen 2019-12-03 11:20:49 +01:00
parent c4d4abcb6b
commit 473040b48e
1 changed files with 18 additions and 14 deletions

View File

@ -676,7 +676,7 @@
{
"data": {
"text/plain": [
"2929687412616"
"1454938262984"
]
},
"execution_count": 20,
@ -696,7 +696,7 @@
{
"data": {
"text/plain": [
"2929687412616"
"1454938262984"
]
},
"execution_count": 21,
@ -852,8 +852,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"x_new has object id: 2929687753800 \n",
"y_new has object id: 2929687504072\n"
"x_new has object id: 1454938263112 \n",
"y_new has object id: 1454939006024\n"
]
}
],
@ -872,8 +872,8 @@
"### Syntax of `for`-loops\n",
" \n",
"~~~python\n",
" for item in iterable:\n",
" # Code goes here (must be indented!)\n",
"for item in iterable:\n",
" # Code goes here (must be indented!)\n",
"~~~\n",
"\n",
"\n",
@ -890,18 +890,22 @@
"metadata": {},
"outputs": [
{
"ename": "SyntaxError",
"evalue": "invalid syntax (<ipython-input-28-2d3eb657ed9c>, line 3)",
"output_type": "error",
"traceback": [
"\u001b[1;36m File \u001b[1;32m\"<ipython-input-28-2d3eb657ed9c>\"\u001b[1;36m, line \u001b[1;32m3\u001b[0m\n\u001b[1;33m print(num))\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
"name": "stdout",
"output_type": "stream",
"text": [
"0\n",
"1\n",
"2\n",
"3\n",
"4\n",
"5\n"
]
}
],
"source": [
"# Printing numbers from 0-5\n",
"for num in [0, 1, 2, 3, 4, 5]:\n",
" print(num))"
" print(num)"
]
},
{
@ -1014,8 +1018,8 @@
" \n",
"### Syntax of `while`-loops \n",
"~~~python\n",
" while condition: \n",
" # Code goes here (must be indented!)\n",
"while condition: \n",
" # Code goes here (must be indented!)\n",
"~~~\n",
"\n",
"Where evaluation of `condition` must return a boolean (`True` or `False`).\n",