Skip to content

Python3 versions of notebooks #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions Day01/DataTypeBasics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand All @@ -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"
]
},
{
Expand All @@ -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)"
]
},
{
Expand Down
12 changes: 6 additions & 6 deletions Day01/MappingClimateChange01.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 3,
"metadata": {
"collapsed": false
},
Expand Down Expand Up @@ -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,
Expand Down
28 changes: 14 additions & 14 deletions Day02/DataTypesReview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"\n",
"a = \"hi\"\n",
"\n",
"print a"
"print(a)"
]
},
{
Expand All @@ -29,7 +29,7 @@
"y = [1, 2, 3]\n",
"z = [4, 5]\n",
"\n",
"print a + b"
"print(a + b)"
]
},
{
Expand All @@ -40,7 +40,7 @@
},
"outputs": [],
"source": [
"print y + z"
"print(y + z)"
]
},
{
Expand All @@ -52,7 +52,7 @@
},
"outputs": [],
"source": [
"print y + a"
"print(y + a)"
]
},
{
Expand All @@ -69,7 +69,7 @@
"b = 3.0\n",
"c = 3\n",
"\n",
"print a / b"
"print(a / b)"
]
},
{
Expand All @@ -80,7 +80,7 @@
},
"outputs": [],
"source": [
"print a / c"
"print(a / c)"
]
},
{
Expand All @@ -96,7 +96,7 @@
"greeting = \"Hello everyone\"\n",
"bye = \" Goodbye everyone\"\n",
"\n",
"print len(bye)"
"print(len(bye))"
]
},
{
Expand All @@ -108,7 +108,7 @@
},
"outputs": [],
"source": [
"print greeting - bye "
"print(greeting - bye)"
]
},
{
Expand All @@ -119,7 +119,7 @@
},
"outputs": [],
"source": [
"print greeting + bye"
"print(greeting + bye)"
]
},
{
Expand All @@ -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,
Expand Down
34 changes: 17 additions & 17 deletions Day02/ForLoopBreakdown.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"source": [
"students = [\"Kunta\", \"Rosie\", \"Jimmy\", \"Jess\"]\n",
"\n",
"print students"
"print(students)"
]
},
{
Expand All @@ -21,7 +21,7 @@
},
"outputs": [],
"source": [
"print students(0)"
"print(students(0))"
]
},
{
Expand All @@ -32,7 +32,7 @@
},
"outputs": [],
"source": [
"print students[3]"
"print(students[3])"
]
},
{
Expand All @@ -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)"
]
},
{
Expand All @@ -60,7 +60,7 @@
"outputs": [],
"source": [
"for i in range(len(students)):\n",
" print students[i]"
" print(students[i])"
]
},
{
Expand All @@ -72,7 +72,7 @@
"outputs": [],
"source": [
"for item in students:\n",
" print item"
" print(item)"
]
},
{
Expand All @@ -84,7 +84,7 @@
"outputs": [],
"source": [
"for i in range(len(students)):\n",
" print \"hi \" + students[i]"
" print(\"hi \" + students[i])"
]
},
{
Expand All @@ -96,7 +96,7 @@
"outputs": [],
"source": [
"students[0] = \"ABSENT\"\n",
"print students"
"print(students)"
]
},
{
Expand All @@ -111,7 +111,7 @@
"for i in range(len(students)):\n",
" students[i] = \"hi \" + students[i]\n",
" \n",
"print students"
"print(students)"
]
},
{
Expand All @@ -126,7 +126,7 @@
"\n",
"for item in students:\n",
" allStudents = allStudents + item\n",
"print allStudents"
"print(allStudents)"
]
},
{
Expand All @@ -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,
Expand Down
Loading