summaryrefslogtreecommitdiff
path: root/C++_from_the_Ground/Chapter_21(1).ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'C++_from_the_Ground/Chapter_21(1).ipynb')
-rw-r--r--C++_from_the_Ground/Chapter_21(1).ipynb34
1 files changed, 9 insertions, 25 deletions
diff --git a/C++_from_the_Ground/Chapter_21(1).ipynb b/C++_from_the_Ground/Chapter_21(1).ipynb
index 023fd126..76345922 100644
--- a/C++_from_the_Ground/Chapter_21(1).ipynb
+++ b/C++_from_the_Ground/Chapter_21(1).ipynb
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
- "signature": "sha256:0975c16101ec7adc0b19a0a24a31504acce776790d976f2710d7048c660d7882"
+ "signature": "sha256:1f6065242a1ea235eb4712b9ec147fb29625df8861301b52ad6c880a94467811"
},
"nbformat": 3,
"nbformat_minor": 0,
@@ -26,16 +26,11 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\n",
- "\n",
- "#Variable declaratio\n",
+ " \n",
"v=[] #Create a zero length vector\n",
- "\n",
- "#display original size of v\n",
+ " \n",
"print \"Size =\",len(v)\n",
- "\n",
- "#put values onto end of vector\n",
- "#vector will grow as needed\n",
+ " \n",
"\n",
"for i in range(10):\n",
" v.append(i)\n",
@@ -304,9 +299,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\n",
- " \n",
- "#Variable declaration\n",
+ " \n",
"v=[]\n",
"v2=[]\n",
"\n",
@@ -699,8 +692,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\n",
- "#define the function find\n",
+ " \n",
"def find(x,ch):\n",
" for p in x:\n",
" if p[0].get()==ch.get():\n",
@@ -766,9 +758,6 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\n",
- "\n",
- "#This is a unary precdate that determines if character is a vowel\n",
"def isvowel(ch):\n",
" ch=ch.lower()\n",
" if (ch=='a' or ch=='e'or ch=='i' or ch=='o' or ch=='u'):\n",
@@ -886,9 +875,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\n",
- "\n",
- "#Variable declaration\n",
+ " \n",
"v=[]\n",
"\n",
"for i in range(10):\n",
@@ -933,9 +920,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\n",
- "\n",
- "#A simple transformaton function\n",
+ " \n",
"def xform(i):\n",
" return i*i #square original value\n",
"\n",
@@ -1147,8 +1132,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\n",
- "#define the function find\n",
+ " \n",
"def find(x,ch):\n",
" for p in x:\n",
" if p[0]==ch:\n",