diff --git a/dip3.css b/dip3.css index ce59fa0..5fd56b8 100644 --- a/dip3.css +++ b/dip3.css @@ -1,6 +1,6 @@ /* typography */ -body,.widgets a{font:normal medium Jara,'Nimbus Sans L','Gill Sans','Gill Sans MT',Corbel,Helvetica,sans-serif;line-height:1.75;word-spacing:0.1em} -pre,kbd,code,samp{font:normal medium 'Liberation Mono','Bitstream Vera Sans Mono','DejaVu Sans Mono',Consolas,'Andale Mono',Monaco,monospace;font-size:medium;line-height:1.75;word-spacing:0} +body,.widgets a{font:normal medium 'Gill Sans','Gill Sans MT',Corbel,Helvetica,Jara,'Nimbus Sans L',sans-serif;line-height:1.75;word-spacing:0.1em} +pre,kbd,code,samp{font:normal medium Consolas,'Andale Mono',Monaco,'Liberation Mono','Bitstream Vera Sans Mono','DejaVu Sans Mono',monospace;font-size:medium;line-height:1.75;word-spacing:0} span,tr + tr th:first-child{font:normal medium FreeSerif,OpenSymbol,'DejaVu Sans','Arial Unicode MS',sans-serif} pre span{font:normal medium 'DejaVu Sans',FreeSerif,OpenSymbol,'Arial Unicode MS',sans-serif} .baa{font:oblique large Baskerville,Constantia,Palatino,'Palatino Linotype','URW Palladio L',serif} @@ -9,7 +9,7 @@ abbr{font-variant:small-caps;letter-spacing:0.1em;text-transform:lowercase} .fancy:first-letter{float:left;background:transparent;color:gainsboro;padding:0.11em 4px 0 0;font:normal 4em/0.68 serif} .q span{font-size:large} .note{margin-left:4.94em} -.note span{display:block;float:left;font-weight:bold;font-size:xx-large;line-height:0.875;margin:0 0.22em 0 -1.22em} +.note span{display:block;float:left;font-size:xx-large;line-height:0.875;margin:0 0.22em 0 -1.22em} /* basics */ html{background:#fff;color:#000} diff --git a/native-datatypes.html b/native-datatypes.html index 124405a..0edb74f 100644 --- a/native-datatypes.html +++ b/native-datatypes.html @@ -21,36 +21,19 @@ body{counter-reset:h1 2}
  • Diving in
  • Booleans
  • Numbers -
  • Lists
      -
    1. Creating lists -
    2. Slicing lists +
    3. Creating a list +
    4. Slicing a list +
    5. Adding items to a list +
    6. Searching for values in a list
    -
  • Sets @@ -572,7 +479,7 @@ True
    File "<stdin>", line 1, in <module> KeyError: 'db.diveintopython3.org'
      -
    1. First, you create a new dictionary with two elements and assign it to the variable a_dict. Each element is a key-value pair, and the whole set of elements is enclosed in curly braces. +
    2. First, you create a new dictionary with two items and assign it to the variable a_dict. Each item is a key-value pair, and the whole set of items is enclosed in curly braces.
    3. 'server' is a key, and its associated value, referenced by a_dict["server"], is 'db.diveintopython3.org'.
    4. 'database' is a key, and its associated value, referenced by a_dict["database"], is 'mysql'.
    5. You can get values by key, but you can't get keys by value. So a_dict["server"] is 'db.diveintopython3.org', but a_dict["db.diveintopython3.org"] raises an exception, because 'db.diveintopython3.org' is not a key. @@ -596,7 +503,7 @@ KeyError: 'db.diveintopython3.org'
      1. You can not have duplicate keys in a dictionary. Assigning a value to an existing key will wipe out the old value.
      2. You can add new key-value pairs at any time. This syntax is identical to modifying existing values. -
      3. The new dictionary item (key 'user', value 'mark') appears to be in the middle. In fact, it was just a coincidence that the elements appeared to be in order in the first example; it is just as much a coincidence that they appear to be out of order now. +
      4. The new dictionary item (key 'user', value 'mark') appears to be in the middle. In fact, it was just a coincidence that the items appeared to be in order in the first example; it is just as much a coincidence that they appear to be out of order now.
      5. Assigning a value to an existing dictionary key simply replaces the old value with the new one.
      6. Will this change the value of the user key back to "mark"? No! Look at the key closely — that's a capital U in "User". Dictionary keys are case-sensitive, so this statement is creating a new key-value pair, not overwriting an existing one. It may look similar to you, but as far as Python is concerned, it's completely different.