As dictionaries are not introduced previously in lesson (maybe a consequence of reducing the lesson) I suggest the following:
Moving this exercise at the end of the first lession section - before syntax errors (will be used to ensure that students have understood the traceback - and it is time for an exercice)
Then this will also provide a good introduction to syntax errors (as the key error is a syntax error, and will naturly flow with the Caturday joke)
Provide a short introduction to exercise: so that students can read the exercise more easily without focussing on the fact that they have not encountered dictionaries before
This can be introduced (in a minimal way) by the instructor when introducing the exercise and should not take more than 1 min (avoiding extra material load for the course)
In this exercise we introduce a data structure that you did not previously encounter: dictionary.
In a dictionary: keys are associated to values: key-values pairs. Values can be of different types (ie:numbers, lists...) but keys must be unique and immutable (no lists). Dictionaries can be constructed using the following syntax: a_dictionary = {'key1' : value1, 'key2': value2}
Dictionaries are not ordered, consequently we cannot access values using indexes, but we can acess values using their corresponding key. Ex: print(a_dictionary['key1'])
All the best
Eve
The text was updated successfully, but these errors were encountered:
The exercise "Reading Error Messages" is moved before the "Syntax
Errors" section, in order to ensure learners understood Tracebacks
before moving onwards.
Related to swcarpentry#783
tobiashuste
added a commit
to tobiashuste/python-novice-inflammation
that referenced
this issue
Mar 2, 2020
A dictionary is used in the "Reading Error Messages" exercise which has
not been introduced before. The learner should be able to get to know
dictionaries by this very brief explanation.
Closesswcarpentry#783
NB: Good first issue label (cannot be added because not in contributor list)
Exercise
Reading error Messages
- Lesson "Error and Exceptions"(http://swcarpentry.github.io/python-novice-inflammation/09-errors/index.html)
Then this will also provide a good introduction to syntax errors (as the key error is a syntax error, and will naturly flow with the Caturday joke)
This can be introduced (in a minimal way) by the instructor when introducing the exercise and should not take more than 1 min (avoiding extra material load for the course)
All the best
Eve
The text was updated successfully, but these errors were encountered: