summaryrefslogtreecommitdiff
path: root/Beginning_C_By_Ivon_Horton/chapter3.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Beginning_C_By_Ivon_Horton/chapter3.ipynb')
-rw-r--r--Beginning_C_By_Ivon_Horton/chapter3.ipynb49
1 files changed, 13 insertions, 36 deletions
diff --git a/Beginning_C_By_Ivon_Horton/chapter3.ipynb b/Beginning_C_By_Ivon_Horton/chapter3.ipynb
index 49245eb1..74bd1aaf 100644
--- a/Beginning_C_By_Ivon_Horton/chapter3.ipynb
+++ b/Beginning_C_By_Ivon_Horton/chapter3.ipynb
@@ -1,6 +1,7 @@
{
"metadata": {
- "name": ""
+ "name": "",
+ "signature": "sha256:395f91f52f5165130592aef7f92afdbea52f690b93426a4caf3da2a8b3404bd6"
},
"nbformat": 3,
"nbformat_minor": 0,
@@ -27,9 +28,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "A simple example of the if statement\n",
- "\"\"\"\n",
+ "\n",
"\n",
"number = 0;\n",
"print \"\\nEnter an integer between 1 and 10: \",\n",
@@ -82,9 +81,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "Using if statements to decide on a discount\n",
- "\"\"\"\n",
+ "\n",
"\n",
"unit_price = 3.50\n",
"print \"Enter the number that you want to buy: \", \n",
@@ -137,10 +134,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "Using nested ifs to analyze numbers\n",
- "note: no need of LONG_MAX as there is no limit in python for an integer value\n",
- "\"\"\"\n",
+ "\n",
"\n",
"test = 0.0\n",
"print \"Enter an integer: \",\n",
@@ -196,9 +190,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "Converting uppercase to lowercase\n",
- "\"\"\"\n",
+ "\n",
"\n",
"print \"Enter an uppercase letter:\",\n",
"letter = raw_input()\n",
@@ -249,9 +241,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "Testing letters an easier way\n",
- "\"\"\"\n",
+ "\n",
"\n",
"print \"Enter an uppercase letter:\",\n",
"letter = raw_input()\n",
@@ -301,9 +291,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "Multiple Discount Levels\n",
- "\"\"\"\n",
+ "\n",
"\n",
"unit_price = 3.50\n",
"discount1 = 0.05\n",
@@ -365,9 +353,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "A confused recruiting policy \n",
- "\"\"\"\n",
+ "\n",
"\n",
"age = 0\n",
"college = 0\n",
@@ -465,10 +451,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "Lucky Lotteries\n",
- "note: there is no switch statement in Python\n",
- "\"\"\"\n",
+ "\n",
"\n",
"print \"Pick a number between 1 and 10 and you may win a prize! \",\n",
"choice = int(raw_input())\n",
@@ -527,9 +510,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "Testing cases\n",
- "\"\"\"\n",
+ "\n",
"\n",
"print \"Enter Y or N: \",\n",
"answer = raw_input()\n",
@@ -581,9 +562,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "Excercising bitwise operator\n",
- "\"\"\"\n",
+ "\n",
"\n",
"original = 0xABC\n",
"result = 0\n",
@@ -627,9 +606,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "\"\"\"\n",
- "A calculator\n",
- "\"\"\"\n",
+ "\n",
"\n",
"print \"Enter the calculation\\n\",\n",
"number1 = float(raw_input(\"Enter first number: \"))\n",