{"id":2737,"date":"2018-02-09T10:35:58","date_gmt":"2018-02-09T01:35:58","guid":{"rendered":"http:\/\/nantoka.filmm.info\/blog\/?p=2737"},"modified":"2018-02-09T12:50:36","modified_gmt":"2018-02-09T03:50:36","slug":"microbit%e3%81%a7dictionary","status":"publish","type":"post","link":"https:\/\/nantoka.filmm.info\/blog\/?p=2737","title":{"rendered":"micro:bit\u3067Dictionary"},"content":{"rendered":"<p>micro:bit\u3067Dictionary\u3064\u304b\u3048\u308b\u3084\u3093\uff0c\uff0c\uff0c\u6570\u6642\u9593\u7121\u99c4\u306b\u3057\u305f<\/p>\n<pre class=\"lang:default decode:true\">from microbit import *\r\nmyDict = {\r\n    'id':1000,\r\n    'id2':2000\r\n}\r\n\r\nwhile True:\r\n    if button_a.is_pressed():\r\n        cat = myDict.get('id')\r\n        display.scroll(str(cat))\r\n        #display.show(Image.HEART)\r\n        sleep(2000)\r\n    if button_b.is_pressed():\r\n        cat = myDict.get('id2')\r\n        display.scroll(str(cat))\r\n        #display.show(Image.HEART)\r\n        sleep(2000)<\/pre>\n<p>\u5024\u3092\u66f4\u65b0\u3068\u8ffd\u52a0\u306f<\/p>\n<pre class=\"lang:default decode:true\">inu = {'key2':400}\r\nmyDict.update(inu)<\/pre>\n<p>Dictionary\u306e\u4e2d\u8eab\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u306b\u306f\uff08Key,Value\u306e\u4e21\u65b9\uff09<\/p>\n<pre class=\"lang:default decode:true \">for k, v in myDict.items():<\/pre>\n<p>\u3053\u308c\u3067k \u306bkey\u304cv\u306bValue\u304c\u5165\u308b<\/p>\n<hr \/>\n<p>\u30b9\u30af\u30ed\u30fc\u30eb\u901f\u5ea6\u901f\u304f<\/p>\n<pre class=\"lang:default decode:true \">display.scroll('cat', delay = 100)<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>micro:bit\u3067Dictionary\u3064\u304b\u3048\u308b\u3084\u3093\uff0c\uff0c\uff0c\u6570\u6642\u9593\u7121\u99c4\u306b\u3057\u305f from microbit import * myDict = { &#8216;id&#8217;:1000, &#8216;id2&#8217;:2000 } while True: if &hellip; <a href=\"https:\/\/nantoka.filmm.info\/blog\/?p=2737\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">micro:bit\u3067Dictionary<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[44,54,51],"tags":[],"class_list":["post-2737","post","type-post","status-publish","format-standard","hentry","category-iot","category-microbit","category-python"],"_links":{"self":[{"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2737","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2737"}],"version-history":[{"count":7,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2737\/revisions"}],"predecessor-version":[{"id":2745,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2737\/revisions\/2745"}],"wp:attachment":[{"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2737"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}