Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 4cb98a81 authored by Loic Huder's avatar Loic Huder
Browse files

Added a line to show tuple type in returns in pres07

parent 26cdc630
......@@ -356,13 +356,14 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<class 'tuple'> (1, 2, 3)\n",
"1 2 3\n"
]
}
......@@ -371,6 +372,9 @@
"def myfunc():\n",
" return 1, 2, 3\n",
"\n",
"t = myfunc()\n",
"print(type(t), t)\n",
"# Directly unpacking the tuple\n",
"a, b, c = myfunc()\n",
"print(a, b, c)"
]
......@@ -1027,7 +1031,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.2"
"version": "3.6.6"
}
},
"nbformat": 4,
......
......@@ -337,7 +337,7 @@
"Tests that the station generation throws an error ... ok\n",
"\n",
"----------------------------------------------------------------------\n",
"Ran 4 tests in 0.005s\n",
"Ran 4 tests in 0.006s\n",
"\n",
"OK\n"
]
......@@ -424,7 +424,7 @@
"\n",
"A class defines a template used for building object. \n",
"In our example, the class (named `WeatherStation`) defines the specifications of what is a weather station (*i.e*, a weather station should contain an array for wind speeds, named \"wind\", and an array for temperatures, named \"temp\").\n",
"`paris` should now be an object that answers to these specifications. Is is called an *instance* of the class `WeatherStation`.\n",
"`paris` should now be an object that answers to these specifications. Is is called an **instance** of the class `WeatherStation`.\n",
"\n",
"When defining the class, we need to define how to build it (special \"function\" `__init__`). \n"
]
......@@ -531,7 +531,7 @@
"test test_max_temp function ... ok\n",
"\n",
"----------------------------------------------------------------------\n",
"Ran 5 tests in 0.013s\n",
"Ran 5 tests in 0.005s\n",
"\n",
"OK\n"
]
......@@ -589,14 +589,14 @@
"\n",
"- Add a method (`perceived_temp`) that takes as input a temperature and wind and return the perceived temperature, i.e. taking into account the wind chill effect.\n",
"- Modify `max_temp` and `arg_max_temp` so that they take an additional optional boolean parameter (*e.g.* perceived default to False). If `perceived` is False, the methods have the same behaviour as before. If perceived is True, the temperatures to process are the perceived temperatures.\n",
"- Code so that all the tests are ok.\n",
"- Code so that all the tests are passing.\n",
"- Add a tests for a method (`perceived_temperatures`) that returns an array containing all the perceived temperatures.\n",
"- Code the method `perceived_temperatures` so that all tests are ok."
"- Code the method `perceived_temperatures` so that all tests are passing."
]
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 9,
"metadata": {},
"outputs": [
{
......@@ -623,7 +623,7 @@
"test that the perceived temp is the same without wind ... ok\n",
"\n",
"----------------------------------------------------------------------\n",
"Ran 9 tests in 0.010s\n",
"Ran 9 tests in 0.024s\n",
"\n",
"OK\n"
]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment