"Division is a bit weird: if you give it integer arguments, the result will also be an integer."
]
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 8,
"execution_count": 8,
...
@@ -416,13 +423,6 @@
...
@@ -416,13 +423,6 @@
"36 / 5"
"36 / 5"
]
]
},
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Division is a bit weird: if you give it integer arguments, the result will also be an integer."
]
},
{
{
"cell_type": "markdown",
"cell_type": "markdown",
"metadata": {
"metadata": {
...
@@ -598,15 +598,12 @@
...
@@ -598,15 +598,12 @@
"cell_type": "markdown",
"cell_type": "markdown",
"metadata": {
"metadata": {
"slideshow": {
"slideshow": {
"slide_type": "subslide"
"slide_type": "slide"
}
}
},
},
"source": [
"source": [
"Python as a calculator\n",
"===\n",
"\n",
"Variables\n",
"Variables\n",
"---\n",
"===\n",
"\n",
"\n",
"* We can use names to reference values (variables).\n",
"* We can use names to reference values (variables).\n",
"* No need to declare them first or define the type."
"* No need to declare them first or define the type."
...
@@ -671,7 +668,7 @@
...
@@ -671,7 +668,7 @@
}
}
},
},
"source": [
"source": [
"Python's type system (1/3)\n",
"Python's type system (1/4)\n",
"===\n",
"===\n",
"\n",
"\n",
"Every value has a type, view it using `type`:"
"Every value has a type, view it using `type`:"
...
@@ -739,8 +736,15 @@
...
@@ -739,8 +736,15 @@
},
},
{
{
"cell_type": "markdown",
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"source": [
"Python's type system (2/4)\n",
"===\n",
"\n",
"Another example of a builtin datatype is `str`, we'll see more later:"
"Another example of a builtin datatype is `str`, we'll see more later:"
]
]
},
},
...
@@ -768,13 +772,10 @@
...
@@ -768,13 +772,10 @@
"cell_type": "markdown",
"cell_type": "markdown",
"metadata": {
"metadata": {
"slideshow": {
"slideshow": {
"slide_type": "subslide"
"slide_type": "-"
}
}
},
},
"source": [
"source": [
"Python's type system (2/3)\n",
"===\n",
"\n",
"Some operations are defined on more than one type, possibly with different meanings."
"Some operations are defined on more than one type, possibly with different meanings."
]
]
},
},
...
@@ -800,8 +801,15 @@
...
@@ -800,8 +801,15 @@
},
},
{
{
"cell_type": "markdown",
"cell_type": "markdown",
"metadata": {},
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"source": [
"Python's type system (3/4)\n",
"===\n",
"\n",
"Dynamic typing means that variables can be assigned values of different types during runtime."
"Dynamic typing means that variables can be assigned values of different types during runtime."
]
]
},
},
...
@@ -874,7 +882,7 @@
...
@@ -874,7 +882,7 @@
}
}
},
},
"source": [
"source": [
"Python's type system (2/3)\n",
"Python's type system (4/4)\n",
"===\n",
"===\n",
"\n",
"\n",
"Python is strongly typed, meaning that operations on values with incompatible types are forbidden."
"Python is strongly typed, meaning that operations on values with incompatible types are forbidden."
...
@@ -928,7 +936,7 @@
...
@@ -928,7 +936,7 @@
" <li>What is your average speed in miles per hour?</li>\n",
" <li>What is your average speed in miles per hour?</li>\n",
" </ul>\n",
" </ul>\n",
" </li>\n",
" </li>\n",
" <li>Use string operations to reference string 'tra la la la' in a variable named *song*.</li>\n",
" <li>Use string operations to reference string 'tra la la la' in a variable named <i>song</i>.</li>\n",
" <li>If an article costs 249 Euros including the 19% Value Added Tax (VAT), what is the actual VAT amount in Euros for the corresponding article?</li>\n",
" <li>If an article costs 249 Euros including the 19% Value Added Tax (VAT), what is the actual VAT amount in Euros for the corresponding article?</li>\n",