diff --git a/Day01/DataTypeBasics.ipynb b/Day01/DataTypeBasics.ipynb index 3666426..74d648a 100644 --- a/Day01/DataTypeBasics.ipynb +++ b/Day01/DataTypeBasics.ipynb @@ -14,10 +14,10 @@ "num2 = 2.5\n", "num3 = 15\n", "\n", - "print num1 + num2 #Adds numbers together\n", - "print num1 - num2 #Subtract\n", - "print num3/num1 #Divide\n", - "print num2*num3 #Multiply" + "print(num1 + num2) #Adds numbers together\n", + "print(num1 - num2) #Subtract\n", + "print(num3/num1) #Divide\n", + "print(num2*num3) #Multiply" ] }, { @@ -32,11 +32,11 @@ "\n", "w_vs_c_str = \"You dress for the weather. You build your house for the climate.\"\n", "\n", - "print w_vs_c_str #prints the string\n", - "print len(w_vs_c_str) #number of characters in the string\n", - "print w_vs_c_str[0] #prints the character at a specific spot in the string\n", - "print w_vs_c_str[4:9]\n", - "print w_vs_c_str + \" The climate is changing.\" #Adds two strings together" + "print(w_vs_c_str) #prints the string\n", + "print(len(w_vs_c_str)) #number of characters in the string\n", + "print(w_vs_c_str[0]) #prints the character at a specific spot in the string\n", + "print(w_vs_c_str[4:9])\n", + "print(w_vs_c_str + \" The climate is changing.\") #Adds two strings together" ] }, { @@ -50,15 +50,15 @@ "#Lists\n", "\n", "num_lst = [3, 7, 12, 18, 25, 33, 42]\n", - "country_lst = [\"Kenya\", \"Moracco\", \"Indonesia\", \"Germany\"]\n", + "country_lst = [\"Kenya\", \"Morocco\", \"Indonesia\", \"Germany\"]\n", "\n", - "print num_lst #prints the list\n", - "print country_lst\n", - "print len(num_lst) #how many objects are in the list\n", - "print country_lst[2] #prints the object at a specific spot in the list\n", + "print(num_lst) #prints the list\n", + "print(country_lst)\n", + "print(len(num_lst)) #how many objects are in the list\n", + "print(country_lst[2]) #prints the object at a specific spot in the list\n", "\n", - "country_lst.append(3) #adds an element to the list\n", - "print country_lst" + "country_lst.append(\"Thailand\") #adds an element to the list\n", + "print(country_lst)" ] }, { diff --git a/Day01/MappingClimateChange01.ipynb b/Day01/MappingClimateChange01.ipynb index 480f08d..3faae06 100644 --- a/Day01/MappingClimateChange01.ipynb +++ b/Day01/MappingClimateChange01.ipynb @@ -10,7 +10,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 3, "metadata": { "collapsed": false }, @@ -115,21 +115,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.11" + "pygments_lexer": "ipython3", + "version": "3.6.0" } }, "nbformat": 4, diff --git a/Day02/DataTypesReview.ipynb b/Day02/DataTypesReview.ipynb index 00940a2..cf2f64e 100644 --- a/Day02/DataTypesReview.ipynb +++ b/Day02/DataTypesReview.ipynb @@ -12,7 +12,7 @@ "\n", "a = \"hi\"\n", "\n", - "print a" + "print(a)" ] }, { @@ -29,7 +29,7 @@ "y = [1, 2, 3]\n", "z = [4, 5]\n", "\n", - "print a + b" + "print(a + b)" ] }, { @@ -40,7 +40,7 @@ }, "outputs": [], "source": [ - "print y + z" + "print(y + z)" ] }, { @@ -52,7 +52,7 @@ }, "outputs": [], "source": [ - "print y + a" + "print(y + a)" ] }, { @@ -69,7 +69,7 @@ "b = 3.0\n", "c = 3\n", "\n", - "print a / b" + "print(a / b)" ] }, { @@ -80,7 +80,7 @@ }, "outputs": [], "source": [ - "print a / c" + "print(a / c)" ] }, { @@ -96,7 +96,7 @@ "greeting = \"Hello everyone\"\n", "bye = \" Goodbye everyone\"\n", "\n", - "print len(bye)" + "print(len(bye))" ] }, { @@ -108,7 +108,7 @@ }, "outputs": [], "source": [ - "print greeting - bye " + "print(greeting - bye)" ] }, { @@ -119,7 +119,7 @@ }, "outputs": [], "source": [ - "print greeting + bye" + "print(greeting + bye)" ] }, { @@ -134,21 +134,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.11" + "pygments_lexer": "ipython3", + "version": "3.6.0" } }, "nbformat": 4, diff --git a/Day02/ForLoopBreakdown.ipynb b/Day02/ForLoopBreakdown.ipynb index f5b66a1..1cc347d 100644 --- a/Day02/ForLoopBreakdown.ipynb +++ b/Day02/ForLoopBreakdown.ipynb @@ -10,7 +10,7 @@ "source": [ "students = [\"Kunta\", \"Rosie\", \"Jimmy\", \"Jess\"]\n", "\n", - "print students" + "print(students)" ] }, { @@ -21,7 +21,7 @@ }, "outputs": [], "source": [ - "print students(0)" + "print(students(0))" ] }, { @@ -32,7 +32,7 @@ }, "outputs": [], "source": [ - "print students[3]" + "print(students[3])" ] }, { @@ -43,12 +43,12 @@ }, "outputs": [], "source": [ - "print len(students)\n", + "print(len(students))\n", "\n", - "print range(len(students))\n", + "print(range(len(students)))\n", "\n", "for i in range(len(students)):\n", - " print i" + " print(i)" ] }, { @@ -60,7 +60,7 @@ "outputs": [], "source": [ "for i in range(len(students)):\n", - " print students[i]" + " print(students[i])" ] }, { @@ -72,7 +72,7 @@ "outputs": [], "source": [ "for item in students:\n", - " print item" + " print(item)" ] }, { @@ -84,7 +84,7 @@ "outputs": [], "source": [ "for i in range(len(students)):\n", - " print \"hi \" + students[i]" + " print(\"hi \" + students[i])" ] }, { @@ -96,7 +96,7 @@ "outputs": [], "source": [ "students[0] = \"ABSENT\"\n", - "print students" + "print(students)" ] }, { @@ -111,7 +111,7 @@ "for i in range(len(students)):\n", " students[i] = \"hi \" + students[i]\n", " \n", - "print students" + "print(students)" ] }, { @@ -126,7 +126,7 @@ "\n", "for item in students:\n", " allStudents = allStudents + item\n", - "print allStudents" + "print(allStudents)" ] }, { @@ -141,21 +141,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.11" + "pygments_lexer": "ipython3", + "version": "3.6.0" } }, "nbformat": 4, diff --git a/Day02/ForLoopExploration.ipynb b/Day02/ForLoopExploration.ipynb index 9514136..b73ad63 100644 --- a/Day02/ForLoopExploration.ipynb +++ b/Day02/ForLoopExploration.ipynb @@ -8,7 +8,7 @@ }, "outputs": [], "source": [ - "print range(10)" + "print(range(10))" ] }, { @@ -20,7 +20,7 @@ "outputs": [], "source": [ "for i in range(4):\n", - " print i" + " print(i)" ] }, { @@ -35,7 +35,7 @@ "\n", "for i in range(len(numbers)):\n", " numbers[i] = numbers[i]*5\n", - "print numbers" + "print(numbers)" ] }, { @@ -52,14 +52,14 @@ "\n", "for i in range(len(numbers)):\n", " numbers[i] = numbers[i]*5\n", - "print numbers" + "print(numbers)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { - "collapsed": true + "collapsed": false }, "outputs": [], "source": [ @@ -69,7 +69,7 @@ "\n", "for i in range(len(numbers)):\n", " numbers[i] = numbers[i]*5\n", - "print numbers" + "print(numbers)" ] }, { @@ -101,12 +101,12 @@ " Ocean = Ocean + Total*0.45\n", " Bio = Bio + Total*0.13\n", " FFuel = FFuel - Total\n", - " print Year\n", - " print \"Human Activity: \" + str(Total)\n", - " print \"Atmosphere: \" + str(Atm)\n", - " print \"Oceans: \" + str(Ocean)\n", - " print \"Biosphere: \" + str(Bio)\n", - " print \"Fossil Fuels: \" + str(FFuel)\n", + " print(Year)\n", + " print(\"Human Activity: \" + str(Total))\n", + " print(\"Atmosphere: \" + str(Atm))\n", + " print(\"Oceans: \" + str(Ocean))\n", + " print(\"Biosphere: \" + str(Bio))\n", + " print(\"Fossil Fuels: \" + str(FFuel))\n", " Year = Year + 10\n", " Total = 0\n", " " @@ -124,21 +124,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.11" + "pygments_lexer": "ipython3", + "version": "3.6.0" } }, "nbformat": 4, diff --git a/Day03/CodingConditionals.ipynb b/Day03/CodingConditionals.ipynb index 51137be..8e5ef4a 100644 --- a/Day03/CodingConditionals.ipynb +++ b/Day03/CodingConditionals.ipynb @@ -11,9 +11,9 @@ "n = 20\n", "\n", "if n == 30:\n", - " print \"Equal to 30\"\n", + " print(\"Equal to 30\")\n", "else:\n", - " print \"Not equal to 30\"" + " print(\"Not equal to 30\")" ] }, { @@ -30,15 +30,15 @@ "wildPandas = 1864\n", "\n", "if wildPandas > 10000:\n", - " print \"Not an endangered species\"\n", + " print(\"Not an endangered species\")\n", "elif wildPandas <= 2500:\n", - " print \"Endangered species\"\n", + " print(\"Endangered species\")\n", "elif wildPandas <= 250:\n", - " print \"CRITICALLY endangered\"\n", + " print(\"CRITICALLY endangered\")\n", "elif wildPandas == 0:\n", - " print \"Extinct :(\"\n", + " print(\"Extinct :(\")\n", "else:\n", - " print \"Make sure you are submitting a positive number\"" + " print(\"Make sure you are submitting a positive number\")" ] }, { @@ -52,11 +52,11 @@ "#determine your team\n", "birthyear = 1991\n", "if birthyear == 2003:\n", - " print \"Team Beyonce!\"\n", + " print(\"Team Beyonce!\")\n", "elif birthyear == 2004:\n", - " print \"Team Rihanna!\"\n", + " print(\"Team Rihanna!\")\n", "else:\n", - " print \"Team Taylor!\"" + " print(\"Team Taylor!\")" ] }, { @@ -72,13 +72,13 @@ "# Then, modify the code so it includes \"D\"\n", "\n", "if score >= 90.0:\n", - " print \"A\"\n", + " print(\"A\")\n", "elif score >= 80.0:\n", - " print \"B\"\n", + " print(\"B\")\n", "elif score >= 70.0:\n", - " print \"C\"\n", + " print(\"C\")\n", "else:\n", - " print \"F\"\n" + " print(\"F\")\n" ] }, { @@ -120,21 +120,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.11" + "pygments_lexer": "ipython3", + "version": "3.6.0" } }, "nbformat": 4, diff --git a/Day03/ForLoopReview.ipynb b/Day03/ForLoopReview.ipynb index 7cb51c6..c2ab20c 100644 --- a/Day03/ForLoopReview.ipynb +++ b/Day03/ForLoopReview.ipynb @@ -10,7 +10,7 @@ "source": [ "months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"]\n", "\n", - "print len(months)" + "print(len(months))" ] }, { @@ -21,7 +21,7 @@ }, "outputs": [], "source": [ - "print range(len(months)) " + "print(range(len(months)))" ] }, { @@ -32,7 +32,7 @@ }, "outputs": [], "source": [ - "print months[0]" + "print(months[0])" ] }, { @@ -43,7 +43,7 @@ }, "outputs": [], "source": [ - "print months[6]" + "print(months[6])" ] }, { @@ -55,7 +55,7 @@ "outputs": [], "source": [ "for m in months:\n", - " print m" + " print(m)" ] }, { @@ -69,7 +69,7 @@ "source": [ "l = len(months)\n", "for i in range(l):\n", - " print i" + " print(i)" ] }, { @@ -82,7 +82,7 @@ "source": [ "l = len(months)\n", "for i in range(l):\n", - " print months[i]" + " print(months[i])" ] }, { @@ -95,7 +95,7 @@ "source": [ "l = len(months)\n", "for i in range(l):\n", - " print months[i] +\" has 30 days.\"\n", + " print(months[i] +\" has 30 days.\")\n", "#is there a problem with this loop?" ] }, @@ -111,21 +111,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.11" + "pygments_lexer": "ipython3", + "version": "3.6.0" } }, "nbformat": 4, diff --git a/Day03/MappingClimateChange03.ipynb b/Day03/MappingClimateChange03.ipynb index 8a7f98c..e45985d 100644 --- a/Day03/MappingClimateChange03.ipynb +++ b/Day03/MappingClimateChange03.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": { "collapsed": true }, @@ -14,7 +14,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": { "collapsed": false }, @@ -115,21 +115,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.11" + "pygments_lexer": "ipython3", + "version": "3.6.0" } }, "nbformat": 4, diff --git a/Day03/WaterCycleGraphs.ipynb b/Day03/WaterCycleGraphs.ipynb index e487294..6363513 100644 --- a/Day03/WaterCycleGraphs.ipynb +++ b/Day03/WaterCycleGraphs.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "metadata": { "collapsed": false }, @@ -45,12 +45,12 @@ "totalSteps = sum(numbers)\n", "percentages = np.array(numbers)/float(totalSteps)*100\n", "\n", - "print percentages" + "print(percentages)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "metadata": { "collapsed": false }, @@ -67,7 +67,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "metadata": { "collapsed": false }, @@ -89,21 +89,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.11" + "pygments_lexer": "ipython3", + "version": "3.6.0" } }, "nbformat": 4, diff --git a/Day04/MappingCode.ipynb b/Day04/MappingCode.ipynb index f59055a..c504f46 100644 --- a/Day04/MappingCode.ipynb +++ b/Day04/MappingCode.ipynb @@ -41,8 +41,8 @@ " else:\n", " pixels[i,j] = (0, 225, 0)\n", "\n", - "print \"Minimum data value is\", min(dataValues)\n", - "print \"Maximum data value is\", max(dataValues) \n", + "print(\"Minimum data value is\", min(dataValues))\n", + "print(\"Maximum data value is\", max(dataValues))\n", "\n", "ImageOps.mirror(img.rotate(270, expand=1)).show()" ] @@ -78,21 +78,21 @@ "metadata": { "anaconda-cloud": {}, "kernelspec": { - "display_name": "Python [Root]", + "display_name": "Python 3", "language": "python", - "name": "Python [Root]" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.11" + "pygments_lexer": "ipython3", + "version": "3.6.0" } }, "nbformat": 4, diff --git a/EducatorGuide/Conditionals.ipynb b/EducatorGuide/Conditionals.ipynb index 17e231b..5bcd516 100644 --- a/EducatorGuide/Conditionals.ipynb +++ b/EducatorGuide/Conditionals.ipynb @@ -2,19 +2,11 @@ "cells": [ { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Team Green!\n" - ] - } - ], + "outputs": [], "source": [ "def colorTeam(birthyear):\n", " if birthyear == 2003:\n", @@ -24,7 +16,7 @@ " else:\n", " return \"Team Blue!\"\n", "\n", - "print colorTeam(2004)" + "print(colorTeam(2004))" ] }, { @@ -38,9 +30,9 @@ "n = 20\n", "\n", "if n == 30: #Tests for equality\n", - " print \"Equal to 30\"\n", + " print(\"Equal to 30\")\n", "else:\n", - " print \"Not equal to 30\"\n", + " print(\"Not equal to 30\")\n", " \n", "if n != 15: #Tests for inequality\n", "\n", @@ -56,21 +48,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.11" + "pygments_lexer": "ipython3", + "version": "3.6.0" } }, "nbformat": 4, diff --git a/EducatorGuide/DataTypeChallenges.ipynb b/EducatorGuide/DataTypeChallenges.ipynb index 8aeadb7..8bd3fd7 100644 --- a/EducatorGuide/DataTypeChallenges.ipynb +++ b/EducatorGuide/DataTypeChallenges.ipynb @@ -13,9 +13,9 @@ "num3 = 15\n", "num4 = -4.8\n", "\n", - "print num1**num3 # To the power\n", - "print num3%num2 # Finds the remainder\n", - "print abs(num4) # Takes the absolute value of a number" + "print(num1**num3) # To the power\n", + "print(num3%num2) # Finds the remainder\n", + "print(abs(num4)) # Takes the absolute value of a number" ] }, { @@ -29,9 +29,9 @@ "str1 = \"You dress for the weather.\"\n", "str2 = \"You build your house for the climate.\"\n", "\n", - "print \"you\" in str2 # Returns true if the character or phrase is in the string\n", - "print str1.swapcase() # Flips the cases of all the letters\n", - "print str1.lower() # Makes all the letters lower case\n", + "print(\"you\" in str2) # Returns true if the character or phrase is in the string\n", + "print(str1.swapcase()) # Flips the cases of all the letters\n", + "print(str1.lower()) # Makes all the letters lower case\n", "lst3 = str2.split() # Splits the phrase into a list of words" ] }, @@ -44,10 +44,10 @@ "outputs": [], "source": [ "lst1 = [3,7,12,18,25,33,42]\n", - "lst2 = [\"Kenya\", \"Moracco\", \"Indonesia\", \"Germany\"]\n", + "lst2 = [\"Kenya\", \"Morocco\", \"Indonesia\", \"Germany\"]\n", "\n", "lst2.append(\"France\") # Adds an object to the end of the list\n", - "print lst2.count(\"Kenya\") # How many times does an object appear in a list" + "print(lst2.count(\"Kenya\")) # How many times does an object appear in a list" ] }, { @@ -62,7 +62,7 @@ "\n", "lst = [4,5,66,12,7,123.000,12.3,90]\n", "\n", - "print sum(lst)" + "print(sum(lst))" ] }, { @@ -75,15 +75,15 @@ "source": [ "phrase = \"The brown fox jumped over the black cat the cat was scared\"\n", "words = phrase.split()\n", - "print words\n", - "print words.count(\"the\")\n", + "print(words)\n", + "print(words.count(\"the\"))\n", "\n", "#this doesn't include the first \"The\" since it's capitalized!\n", "# You can use the phrase \"lower\" to make everything lowercase\n", "\n", "lowerPhrase = phrase.lower()\n", "lowerWords = lowerPhrase.split()\n", - "print lowerWords.count(\"the\")\n" + "print(lowerWords.count(\"the\"))\n" ] }, { @@ -105,21 +105,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.11" + "pygments_lexer": "ipython3", + "version": "3.6.0" } }, "nbformat": 4, diff --git a/EducatorGuide/ForLoopChallenges.ipynb b/EducatorGuide/ForLoopChallenges.ipynb index 98350f5..f2b87a6 100644 --- a/EducatorGuide/ForLoopChallenges.ipynb +++ b/EducatorGuide/ForLoopChallenges.ipynb @@ -14,8 +14,8 @@ "\n", "for row in range(dim):\n", " for col in range(dim):\n", - " print \"* \",\n", - " print \"\"" + " print(\"* \"),\n", + " print(\"\")" ] }, { @@ -33,8 +33,8 @@ "for row in range(dim):\n", " for col in range(dim):\n", " if row >= col:\n", - " print \"* \",\n", - " print \"\"" + " print(\"* \"),\n", + " print(\"\")" ] }, { @@ -49,8 +49,8 @@ "\n", "for row in range(len(name)):\n", " for col in range(len(name)):\n", - " print name[row],\n", - " print \"\"" + " print(name[row])\n", + " print(\"\")" ] }, { @@ -63,8 +63,8 @@ "source": [ "for row in range(len(name)):\n", " for col in range(len(name)):\n", - " print name[col] + \" \",\n", - " print \"\"" + " print(name[col] + \" \")\n", + " print(\"\")" ] }, { @@ -79,21 +79,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.11" + "pygments_lexer": "ipython3", + "version": "3.6.0" } }, "nbformat": 4, diff --git a/EducatorGuide/ImageFun.ipynb b/EducatorGuide/ImageFun.ipynb index a9f0f50..a355c37 100644 --- a/EducatorGuide/ImageFun.ipynb +++ b/EducatorGuide/ImageFun.ipynb @@ -33,21 +33,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.11" + "pygments_lexer": "ipython3", + "version": "3.6.0" } }, "nbformat": 4, diff --git a/EducatorGuide/MappingTests.ipynb b/EducatorGuide/MappingTests.ipynb index f195987..3f6c0f4 100644 --- a/EducatorGuide/MappingTests.ipynb +++ b/EducatorGuide/MappingTests.ipynb @@ -108,21 +108,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.11" + "pygments_lexer": "ipython3", + "version": "3.6.0" } }, "nbformat": 4, diff --git a/EducatorGuide/Saving.ipynb b/EducatorGuide/Saving.ipynb index 83d10c5..80eec17 100644 --- a/EducatorGuide/Saving.ipynb +++ b/EducatorGuide/Saving.ipynb @@ -21,21 +21,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.11" + "pygments_lexer": "ipython3", + "version": "3.6.0" } }, "nbformat": 4, diff --git a/EducatorGuide/Test.ipynb b/EducatorGuide/Test.ipynb index 2c18fa5..5bf3261 100644 --- a/EducatorGuide/Test.ipynb +++ b/EducatorGuide/Test.ipynb @@ -23,7 +23,7 @@ "def multipleThree(number):\n", " return number*3\n", "\n", - "print multipleThree(15)" + "print(multipleThree(15))" ] }, { @@ -43,7 +43,7 @@ " \n", " return \" \".join(backward)\n", "\n", - "print backwardsphrase(\"Coding is really fun\")" + "print(backwardsphrase(\"Coding is really fun\"))" ] }, { @@ -57,7 +57,7 @@ "def welcomeCCC(name):\n", " return \"Hello \" + name + \", welcome to Coding Climate Change\"\n", "\n", - "print welcomeCCC(\"Jess\")" + "print(welcomeCCC(\"Jess\"))" ] }, { @@ -72,10 +72,10 @@ "num2 = 2.5\n", "num3 = 15\n", "\n", - "print num1 + num2 #Adds numbers together\n", - "print num1 - num2 #Subtract\n", - "print num3/num1 #Divide\n", - "print num2*num3 #Multiply" + "print(num1 + num2) #Adds numbers together\n", + "print(num1 - num2) #Subtract\n", + "print(num3/num1) #Divide\n", + "print(num2*num3) #Multiply" ] }, { @@ -88,11 +88,11 @@ "source": [ "str = \"You dress for the weather. You build your house for the climate.\"\n", "\n", - "print str #prints the string\n", - "print len(str) #number of characters in the string\n", - "print str[0] #prints the character at a specific spot in the string\n", - "print str[4:9] #the characters between two specific spots\n", - "print str + \" The climate is changing.\" #Adds two strings together" + "print(str) #prints the string\n", + "print(len(str)) #number of characters in the string\n", + "print(str[0]) #prints the character at a specific spot in the string\n", + "print(str[4:9]) #the characters between two specific spots\n", + "print(str + \" The climate is changing.\") #Adds two strings together" ] }, { @@ -104,15 +104,15 @@ "outputs": [], "source": [ "lst1 = [3, 7, 12, 18, 25, 33, 42]\n", - "lst2 = [\"Kenya\", \"Moracco\", \"Indonesia\", \"Germany\"]\n", + "lst2 = [\"Kenya\", \"Morocco\", \"Indonesia\", \"Germany\"]\n", "\n", - "print lst1 #prints the list\n", - "print lst2\n", - "print len(lst1) #how many objects are in the list\n", - "print lst2[2] #prints the object at a specific spot in the list\n", + "print(lst1) #prints the list\n", + "print(lst2)\n", + "print(len(lst1)) #how many objects are in the list\n", + "print(lst2[2])) #prints the object at a specific spot in the list\n", "\n", "lst2.sort() #sorts the list\n", - "print lst2" + "print(lst2)" ] }, { @@ -127,21 +127,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.11" + "pygments_lexer": "ipython3", + "version": "3.6.0" } }, "nbformat": 4, diff --git a/EducatorGuide/forLoops.ipynb b/EducatorGuide/forLoops.ipynb index ffb3109..54a13a1 100644 --- a/EducatorGuide/forLoops.ipynb +++ b/EducatorGuide/forLoops.ipynb @@ -2,19 +2,11 @@ "cells": [ { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "65\n" - ] - } - ], + "outputs": [], "source": [ "birthYear = 2003\n", "\n", @@ -24,55 +16,31 @@ "for i in range(n):\n", " s = s + 5\n", "\n", - "print s\n" + "print(s)\n" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0\n", - "1\n", - "2\n", - "3\n" - ] - } - ], + "outputs": [], "source": [ "for i in range(4):\n", - " print i" + " print(i)" ] }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": { "collapsed": false }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Hello class!\n", - "Hello class!\n", - "Hello class!\n", - "Hello class!\n", - "Hello class!\n", - "Hello class!\n" - ] - } - ], + "outputs": [], "source": [ "for x in range(6):\n", - " print \"Hello class!\"" + " print(\"Hello class!\")" ] }, { @@ -87,21 +55,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.11" + "pygments_lexer": "ipython3", + "version": "3.6.0" } }, "nbformat": 4, diff --git a/EducatorGuide/graphics.ipynb b/EducatorGuide/graphics.ipynb index 700355b..0c59151 100644 --- a/EducatorGuide/graphics.ipynb +++ b/EducatorGuide/graphics.ipynb @@ -955,21 +955,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.11" + "pygments_lexer": "ipython3", + "version": "3.6.0" } }, "nbformat": 4, diff --git a/MappingData/MappingCodeTemplate.ipynb b/MappingData/MappingCodeTemplate.ipynb index a59d5e9..af776d9 100644 --- a/MappingData/MappingCodeTemplate.ipynb +++ b/MappingData/MappingCodeTemplate.ipynb @@ -48,8 +48,8 @@ " else:\n", " pixels[i,j] = (0, 0, 0)\n", "\n", - "print \"Minimum data value is\", min(dataValues)\n", - "print \"Maximum data value is\", max(dataValues)\n", + "print(\"Minimum data value is\", min(dataValues))\n", + "print(\"Maximum data value is\", max(dataValues))\n", " \n", "ImageOps.mirror(img.rotate(270, expand=1)).show()" ] @@ -67,21 +67,21 @@ "metadata": { "anaconda-cloud": {}, "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.11" + "pygments_lexer": "ipython3", + "version": "3.6.0" } }, "nbformat": 4, diff --git a/README.md b/README.md index 74cfa3c..809a361 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,10 @@ # codingclimatechange Materials for the Middle School Coding Climate Change course + +## Prerequisites + +- Jupyter notebook +- PIL (Python Image Library) +- MatPlotLib + +```pip3 install jupyter pillow matplotlib```