summaryrefslogtreecommitdiff
path: root/Beginning_C_By_Ivon_Horton/chapter4.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Beginning_C_By_Ivon_Horton/chapter4.ipynb')
-rw-r--r--Beginning_C_By_Ivon_Horton/chapter4.ipynb58
1 files changed, 15 insertions, 43 deletions
diff --git a/Beginning_C_By_Ivon_Horton/chapter4.ipynb b/Beginning_C_By_Ivon_Horton/chapter4.ipynb
index 1dd29164..72f009be 100644
--- a/Beginning_C_By_Ivon_Horton/chapter4.ipynb
+++ b/Beginning_C_By_Ivon_Horton/chapter4.ipynb
@@ -1,6 +1,7 @@
{
"metadata": {
- "name": ""
+ "name": "",
+ "signature": "sha256:4c41735fb67bb40797fc8ec99d1c0b5c81a6828d699e86fe05c05b6962ed94db"
},
"nbformat": 3,
"nbformat_minor": 0,
@@ -27,9 +28,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "List ten integers\n",
- "\"\"\"\n",
+ "\n",
"\n",
"for count in range (1, 11):\n",
" print count,\n",
@@ -61,9 +60,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "Drawing a box\n",
- "\"\"\"\n",
+ "\n",
"\n",
"print \"**************\"\n",
"for count in range(1, 9):\n",
@@ -104,9 +101,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "Sum the integers from 1 to a user-specified number\n",
- "\"\"\"\n",
+ "\n",
"\n",
"sum = 0\n",
"\n",
@@ -158,11 +153,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "Sum the integers from 1 to a user-specified number (compact version)\n",
- "note: the way specified in book is not possible in Python, it will be same as\n",
- "previous progam\n",
- "\"\"\"\n",
+ "\n",
"\n",
"sum = 0\n",
"\n",
@@ -214,9 +205,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "summing the integers backward\n",
- "\"\"\"\n",
+ "\n",
"\n",
"sum = 0\n",
"\n",
@@ -266,10 +255,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "The almost indefinite loop - computing an average\n",
- "note: there cannot be infinit for loop in python, we will use while loop\n",
- "\"\"\"\n",
+ "\n",
"\n",
"print \"This program calculates the average of any number of values.\"\n",
"total = 0\n",
@@ -406,9 +392,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "A Guessing Game\n",
- "\"\"\"\n",
+ "\n",
"import sys\n",
"\n",
"chosen = 15\n",
@@ -515,9 +499,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "A More Interesting Guessing Game\n",
- "\"\"\"\n",
+ "\n",
"\n",
"from random import *\n",
"\n",
@@ -624,9 +606,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "While programming and summing integers\n",
- "\"\"\"\n",
+ "\n",
"\n",
"sum = 0\n",
"i = 1\n",
@@ -680,9 +660,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "Output a box with given width and height\n",
- "\"\"\"\n",
+ "\n",
"\n",
"MIN_SIZE = 3;\n",
" \n",
@@ -768,9 +746,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "Sums of successive integer sequences\n",
- "\"\"\"\n",
+ "\n",
"\n",
"sum = 0\n",
"count = 0\n",
@@ -836,9 +812,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "Sums of integers with a while loop nested in a for loop\n",
- "\"\"\"\n",
+ "\n",
"\n",
"print \"Enter the number of integers you want to sum: \",\n",
"count = int(raw_input())\n",
@@ -905,9 +879,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "Reversing the digits\n",
- "\"\"\"\n",
+ "\n",
"rebmun = 0\n",
"print \"\\nEnter a positive integer: \",\n",
"number = int(raw_input())\n",