{"id":39077,"date":"2016-11-23T15:08:23","date_gmt":"2016-11-23T21:08:23","guid":{"rendered":"http:\/\/codemathblog.wordpress.com\/?p=348"},"modified":"2016-11-23T15:08:23","modified_gmt":"2016-11-23T21:08:23","slug":"dictionary","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/dictionary\/","title":{"rendered":"Dictionary"},"content":{"rendered":"<p class=\"syndicated-attribution\"><em> --Originally published at <a href=\"https:\/\/codemathblog.wordpress.com\/2016\/11\/23\/dictionary\/\"><a href=\"https:\/\/codemathblog.wordpress.com\">codemathblog.wordpress.com<\/a><\/a><\/em><br \/><\/p>\n<p>A dictionary in python is a key to get a new value from a list of values(the dictionary)<\/p>\n<p><img class=\"alignnone size-full wp-image-378\" src=\"https:\/\/codemathblog.files.wordpress.com\/2016\/11\/ap.jpg?w=748\" alt=\"ap\" srcset=\"https:\/\/codemathblog.files.wordpress.com\/2016\/11\/ap.jpg 500w, https:\/\/codemathblog.files.wordpress.com\/2016\/11\/ap.jpg?w=150 150w, https:\/\/codemathblog.files.wordpress.com\/2016\/11\/ap.jpg?w=300 300w\" sizes=\"(max-width: 500px) 100vw, 500px\"   \/><\/p>\n<p>The sintaxys for a dictionary is<br \/>\nnew_variable={&#8216;word&#8217;:&#8217;Hi&#8217;)<br \/>\nThen we write the name of the dictionary and what we want to translate: \u00a0new_variable[word]<\/p>\n<p>This will print (&#8216;Hi&#8217;)<\/p>\n<p>Lets see an example with code!<\/p>\n<p><img class=\"alignnone size-full wp-image-361\" src=\"https:\/\/codemathblog.files.wordpress.com\/2016\/11\/acv.png?w=748\" alt=\"acv\" srcset=\"https:\/\/codemathblog.files.wordpress.com\/2016\/11\/acv.png 703w, https:\/\/codemathblog.files.wordpress.com\/2016\/11\/acv.png?w=150 150w, https:\/\/codemathblog.files.wordpress.com\/2016\/11\/acv.png?w=300 300w\" sizes=\"(max-width: 703px) 100vw, 703px\"   \/><\/p>\n<p>My function encodes the secret message with the appropiate dictionary<br \/>\nFor example, mi first letter is p returns a &#8216;C&#8217;.<\/p>\n<p>The secret message of the code is:<br \/>\n<img class=\"alignnone size-full wp-image-367\" src=\"https:\/\/codemathblog.files.wordpress.com\/2016\/11\/cs.png?w=748\" alt=\"cs\" srcset=\"https:\/\/codemathblog.files.wordpress.com\/2016\/11\/cs.png 298w, https:\/\/codemathblog.files.wordpress.com\/2016\/11\/cs.png?w=150 150w\" sizes=\"(max-width: 298px) 100vw, 298px\"   \/><\/p>\n<p>Thanks for reading<img src=\"https:\/\/s0.wp.com\/wp-content\/mu-plugins\/wpcom-smileys\/twemoji\/2\/72x72\/1f642.png\" alt=\"?\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/><\/p>\n<p>Here you can find a dictionary guide:<\/p>\n<p><a href=\"https:\/\/www.tutorialspoint.com\/python\/python_dictionary.htm\" rel=\"nofollow\">https:\/\/www.tutorialspoint.com\/python\/python_dictionary.htm<\/a><\/p>\n<p>And a video with examples:<\/p>\n<div class=\"jetpack-video-wrapper\"><iframe class='youtube-player' type='text\/html' width='748' height='451' src='https:\/\/www.youtube.com\/embed\/YNRc6c0wUA8?version=3&#038;rel=1&%23038;fs=1&%23038;autohide=2&%23038;showsearch=0&%23038;showinfo=1&%23038;iv_load_policy=1&%23038;wmode=transparent' allowfullscreen='true' style='border:0;'><\/iframe><\/div>\n<p>&nbsp;<\/p>\n<p>References:<\/p>\n<p>S. a.(2016). Data structures. Recovered from: <a href=\"https:\/\/docs.python.org\/2\/tutorial\/datastructures.html\" rel=\"nofollow\">https:\/\/docs.python.org\/2\/tutorial\/datastructures.html<\/a><\/p>\n<p>&nbsp;<\/p><br \/>  <a rel=\"nofollow\" href=\"http:\/\/feeds.wordpress.com\/1.0\/gocomments\/codemathblog.wordpress.com\/348\/\"><img alt=\"\" border=\"0\" src=\"http:\/\/feeds.wordpress.com\/1.0\/comments\/codemathblog.wordpress.com\/348\/\" \/><\/a> <img alt=\"\" border=\"0\" src=\"https:\/\/pixel.wp.com\/b.gif?host=codemathblog.wordpress.com&#038;blog=115240483&%23038;post=348&%23038;subd=codemathblog&%23038;ref=&%23038;feed=1\" width=\"1\" height=\"1\" \/>","protected":false},"excerpt":{"rendered":"<p>&#8211;Originally published at codemathblog.wordpress.com A dictionary in python is a key to get a new value from a list of values(the dictionary) The sintaxys for a dictionary is new_variable={&#8216;word&#8217;:&#8217;Hi&#8217;) Then we write the name of the dictionary and what we want to translate: \u00a0new_variable[word] This will print (&#8216;Hi&#8217;) Lets see an example with code! My &hellip; <a href=\"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/dictionary\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Dictionary<\/span><\/a><\/p>\n","protected":false},"author":11,"featured_media":378,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[26],"class_list":["post-39077","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogs","category-syndicated","tag-sin-categoria"],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/39077","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/comments?post=39077"}],"version-history":[{"count":22,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/39077\/revisions"}],"predecessor-version":[{"id":43080,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/39077\/revisions\/43080"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/media?parent=39077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/categories?post=39077"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/tags?post=39077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}