{"id":4,"date":"2015-08-31T06:47:57","date_gmt":"2015-08-31T06:47:57","guid":{"rendered":"http:\/\/coolt.ch\/notizen\/?p=4"},"modified":"2015-09-07T10:58:06","modified_gmt":"2015-09-07T10:58:06","slug":"dictionary","status":"publish","type":"post","link":"https:\/\/coolt.ch\/notizen\/dictionary\/","title":{"rendered":"dictionary"},"content":{"rendered":"<p><strong>Syntax<br \/>\n<\/strong>dict = { &#8222;Schl\u00fcsselwort&#8220; : Wert oder &#8222;string&#8220; oder Liste}<br \/>\n<em> !!\u00a0 Die Reihenfolge der Elemente ist zuf\u00e4llig und \u00e4ndert\u00a0 !!<\/em><\/p>\n<p><strong>Wichtigste Funktionen<br \/>\n<\/strong>dict[&#8222;key&#8220;]\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Gibt den Wert heraus<br \/>\ndict[&#8222;key&#8220;] = 5 \u00a0\u00a0\u00a0 Weist neuen Wert zu<br \/>\ndict[&#8222;neu&#8220;] = 6\u00a0\u00a0\u00a0 F\u00fcgt neues Element ein<br \/>\ndel dict[&#8222;key&#8220;]\u00a0\u00a0\u00a0\u00a0 L\u00f6scht das Element<\/p>\n<p><em>dict.keys()\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Gibt alle Schl\u00fcsselw\u00f6rter heraus<\/em><\/p>\n<p>liste = [ dict1, dict2]\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ &lt;typ &#8218;dict&#8216;&gt; wie Varibalen behandeln<\/p>\n<p><strong>For bei dictionary<\/strong><br \/>\nprices = {\u00a0\u00a0 &#8222;banana&#8220; : 4,<br \/>\n.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8222;apple&#8220;\u00a0\u00a0\u00a0\u00a0 : 2\u00a0\u00a0\u00a0 }<br \/>\n<em>Auswerten des Wertes (integer)<br \/>\n<\/em>for i in prices:<br \/>\n.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 print \u00a0 prices[i]\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ out:\u00a0\u00a0\u00a0\u00a0\u00a0 4<br \/>\n.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2<br \/>\n<em>Auswerten des Keyworts (string)<br \/>\n<\/em>for i in prices:<br \/>\n.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 print\u00a0 i \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ out:\u00a0\u00a0\u00a0\u00a0 banana<br \/>\n.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 apple<\/p>\n<p><strong>Info<br \/>\n<\/strong>Ein assoziative Liste, die eine Kombination aus Namen und Werten ist. Sie ist immer ungeordnet, das heisst ihre Eintr\u00e4ge haben keinen fixen Ort in der Liste. Die Werte werden nur \u00fcber das Schl\u00fcsselwort (key) gefunden.<\/p>\n<p><strong>Suchbegriffe<\/strong><br \/>\ndictionary,\u00a0\u00a0 key<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Syntax dict = { &#8222;Schl\u00fcsselwort&#8220; : Wert oder &#8222;string&#8220; oder Liste} !!\u00a0 Die Reihenfolge der Elemente ist zuf\u00e4llig und \u00e4ndert\u00a0 !! Wichtigste Funktionen dict[&#8222;key&#8220;]\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Gibt den Wert heraus dict[&#8222;key&#8220;] = 5 \u00a0\u00a0\u00a0 Weist neuen Wert zu dict[&#8222;neu&#8220;] = 6\u00a0\u00a0\u00a0 F\u00fcgt neues Element ein del dict[&#8222;key&#8220;]\u00a0\u00a0\u00a0\u00a0 L\u00f6scht das Element dict.keys()\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Gibt alle Schl\u00fcsselw\u00f6rter heraus liste = &hellip; <a href=\"https:\/\/coolt.ch\/notizen\/dictionary\/\" class=\"more-link\"><span class=\"screen-reader-text\">dictionary<\/span> weiterlesen<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts\/4"}],"collection":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/comments?post=4"}],"version-history":[{"count":12,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts\/4\/revisions"}],"predecessor-version":[{"id":45,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts\/4\/revisions\/45"}],"wp:attachment":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/media?parent=4"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/categories?post=4"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/tags?post=4"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}