{"id":9908,"date":"2022-09-21T08:45:25","date_gmt":"2022-09-21T03:15:25","guid":{"rendered":"https:\/\/jassweb.com\/solved\/solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed\/"},"modified":"2022-09-21T08:45:25","modified_gmt":"2022-09-21T03:15:25","slug":"solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed","status":"publish","type":"post","link":"https:\/\/jassweb.com\/solved\/solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed\/","title":{"rendered":"[Solved] I have some list of lists. I need to make a dictionary from it.Examples below [closed]"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div id=\"answer-45435623\" class=\"answer js-answer accepted-answer js-accepted-answer\" data-answerid=\"45435623\" data-parentid=\"45434769\" data-score=\"1\" data-position-on-page=\"1\" data-highest-scored=\"1\" data-question-has-accepted-highest-score=\"1\" itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n<div class=\"post-layout\">\n<div class=\"votecell post-layout--left\"><\/div>\n<div class=\"answercell post-layout--right\">\n<div class=\"s-prose js-post-body\" itemprop=\"text\">\n<p>You can try this way : <\/p>\n<pre><code>list1=[['in', 'comparison', 'to', 'dogs', ',', 'cats', 'have', 'not', 'undergone', 'major', 'changes', 'during', 'the', 'domestication', 'process', '.'], ['as', 'cat', 'simply', 'catenates', 'streams', 'of', 'bytes', ',', 'it', 'can', 'be', 'also', 'used', 'to', 'concatenate', 'binary', 'files', ',', 'where', 'it', 'will', 'just', 'concatenate', 'sequence', 'of', 'bytes', '.'], ['a', 'common', 'interactive', 'use', 'of', 'cat', 'for', 'a', 'single', 'file', 'is', 'to', 'output', 'the', 'content', 'of', 'a', 'file', 'to', 'standard', 'output', '.'], ['cats', 'can', 'hear', 'sounds', 'too', 'faint', 'or', 'too', 'high', 'in', 'frequency', 'for', 'human', 'ears', ',', 'such', 'as', 'those', 'made', 'by', 'mice', 'and', 'other', 'small', 'animals', '.']]\n\n\ndict = {v:i for l in list1 for i,v in enumerate(l)}\nprint(dict)\n<\/code><\/pre>\n<p><strong>Output :<\/strong><\/p>\n<pre><code>{'in': 0, 'comparison': 1, 'to': 2, 'dogs': 3, ',': 4, 'cats': 5, 'have': 6, 'not': 7, 'undergone': 8, 'major': 9, 'changes': 10, 'during': 11, 'the': 12, 'domestication': 13, 'process': 14, '.': 15} {'as': 0, 'cat': 1, 'simply': 2, 'catenates': 3, 'streams': 4, 'of': 24, 'bytes': 25, ',': 17, 'it': 19, 'can': 9, 'be': 10, 'also': 11, 'used': 12, 'to': 13, 'concatenate': 22, 'binary': 15, 'files': 16, 'where': 18, 'will': 20, 'just': 21, 'sequence': 23, '.': 26} {'a': 16, 'common': 1, 'interactive': 2, 'use': 3, 'of': 15, 'cat': 5, 'for': 6, 'single': 8, 'file': 17, 'is': 10, 'to': 18, 'output': 20, 'the': 13, 'content': 14, 'standard': 19, '.': 21} {'cats': 0, 'can': 1, 'hear': 2, 'sounds': 3, 'too': 7, 'faint': 5, 'or': 6, 'high': 8, 'in': 9, 'frequency': 10, 'for': 11, 'human': 12, 'ears': 13, ',': 14, 'such': 15, 'as': 16, 'those': 17, 'made': 18, 'by': 19, 'mice': 20, 'and': 21, 'other': 22, 'small': 23, 'animals': 24, '.': 25}\n<\/code><\/pre>\n<\/p><\/div>\n<div class=\"mt24\"><\/div>\n<\/div>\n<p>            <span class=\"d-none\" itemprop=\"commentCount\">2<\/span> <\/p><\/div>\n<\/div>\n<p>[ad_2]<\/p>\n<p>solved I have some list of lists. I need to make a dictionary from it.Examples below [closed] <\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] You can try this way : list1=[[&#8216;in&#8217;, &#8216;comparison&#8217;, &#8216;to&#8217;, &#8216;dogs&#8217;, &#8216;,&#8217;, &#8216;cats&#8217;, &#8216;have&#8217;, &#8216;not&#8217;, &#8216;undergone&#8217;, &#8216;major&#8217;, &#8216;changes&#8217;, &#8216;during&#8217;, &#8216;the&#8217;, &#8216;domestication&#8217;, &#8216;process&#8217;, &#8216;.&#8217;], [&#8216;as&#8217;, &#8216;cat&#8217;, &#8216;simply&#8217;, &#8216;catenates&#8217;, &#8216;streams&#8217;, &#8216;of&#8217;, &#8216;bytes&#8217;, &#8216;,&#8217;, &#8216;it&#8217;, &#8216;can&#8217;, &#8216;be&#8217;, &#8216;also&#8217;, &#8216;used&#8217;, &#8216;to&#8217;, &#8216;concatenate&#8217;, &#8216;binary&#8217;, &#8216;files&#8217;, &#8216;,&#8217;, &#8216;where&#8217;, &#8216;it&#8217;, &#8216;will&#8217;, &#8216;just&#8217;, &#8216;concatenate&#8217;, &#8216;sequence&#8217;, &#8216;of&#8217;, &#8216;bytes&#8217;, &#8216;.&#8217;], [&#8216;a&#8217;, &#8216;common&#8217;, &#8216;interactive&#8217;, &#8216;use&#8217;, &#8216;of&#8217;, &#8230; <a title=\"[Solved] I have some list of lists. I need to make a dictionary from it.Examples below [closed]\" class=\"read-more\" href=\"https:\/\/jassweb.com\/solved\/solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed\/\" aria-label=\"More on [Solved] I have some list of lists. I need to make a dictionary from it.Examples below [closed]\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[349],"class_list":["post-9908","post","type-post","status-publish","format-standard","hentry","category-solved","tag-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[Solved] I have some list of lists. I need to make a dictionary from it.Examples below [closed] - JassWeb<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jassweb.com\/solved\/solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Solved] I have some list of lists. I need to make a dictionary from it.Examples below [closed] - JassWeb\" \/>\n<meta property=\"og:description\" content=\"[ad_1] You can try this way : list1=[[&#039;in&#039;, &#039;comparison&#039;, &#039;to&#039;, &#039;dogs&#039;, &#039;,&#039;, &#039;cats&#039;, &#039;have&#039;, &#039;not&#039;, &#039;undergone&#039;, &#039;major&#039;, &#039;changes&#039;, &#039;during&#039;, &#039;the&#039;, &#039;domestication&#039;, &#039;process&#039;, &#039;.&#039;], [&#039;as&#039;, &#039;cat&#039;, &#039;simply&#039;, &#039;catenates&#039;, &#039;streams&#039;, &#039;of&#039;, &#039;bytes&#039;, &#039;,&#039;, &#039;it&#039;, &#039;can&#039;, &#039;be&#039;, &#039;also&#039;, &#039;used&#039;, &#039;to&#039;, &#039;concatenate&#039;, &#039;binary&#039;, &#039;files&#039;, &#039;,&#039;, &#039;where&#039;, &#039;it&#039;, &#039;will&#039;, &#039;just&#039;, &#039;concatenate&#039;, &#039;sequence&#039;, &#039;of&#039;, &#039;bytes&#039;, &#039;.&#039;], [&#039;a&#039;, &#039;common&#039;, &#039;interactive&#039;, &#039;use&#039;, &#039;of&#039;, ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jassweb.com\/solved\/solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed\/\" \/>\n<meta property=\"og:site_name\" content=\"JassWeb\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-21T03:15:25+00:00\" \/>\n<meta name=\"author\" content=\"Kirat\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kirat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed\/\"},\"author\":{\"name\":\"Kirat\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\"},\"headline\":\"[Solved] I have some list of lists. I need to make a dictionary from it.Examples below [closed]\",\"datePublished\":\"2022-09-21T03:15:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed\/\"},\"wordCount\":44,\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"keywords\":[\"python\"],\"articleSection\":[\"Solved\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed\/\",\"url\":\"https:\/\/jassweb.com\/solved\/solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed\/\",\"name\":\"[Solved] I have some list of lists. I need to make a dictionary from it.Examples below [closed] - JassWeb\",\"isPartOf\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#website\"},\"datePublished\":\"2022-09-21T03:15:25+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/jassweb.com\/solved\/solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/jassweb.com\/solved\/solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/jassweb.com\/solved\/solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/jassweb.com\/solved\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Solved] I have some list of lists. I need to make a dictionary from it.Examples below [closed]\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/jassweb.com\/solved\/#website\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"name\":\"JassWeb\",\"description\":\"Build High-quality Websites\",\"publisher\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/jassweb.com\/solved\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/jassweb.com\/solved\/#organization\",\"name\":\"Jass Web\",\"url\":\"https:\/\/jassweb.com\/solved\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"contentUrl\":\"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png\",\"width\":693,\"height\":132,\"caption\":\"Jass Web\"},\"image\":{\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31\",\"name\":\"Kirat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1776403586\",\"contentUrl\":\"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1776403586\",\"caption\":\"Kirat\"},\"sameAs\":[\"http:\/\/jassweb.com\"],\"url\":\"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Solved] I have some list of lists. I need to make a dictionary from it.Examples below [closed] - JassWeb","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jassweb.com\/solved\/solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed\/","og_locale":"en_US","og_type":"article","og_title":"[Solved] I have some list of lists. I need to make a dictionary from it.Examples below [closed] - JassWeb","og_description":"[ad_1] You can try this way : list1=[['in', 'comparison', 'to', 'dogs', ',', 'cats', 'have', 'not', 'undergone', 'major', 'changes', 'during', 'the', 'domestication', 'process', '.'], ['as', 'cat', 'simply', 'catenates', 'streams', 'of', 'bytes', ',', 'it', 'can', 'be', 'also', 'used', 'to', 'concatenate', 'binary', 'files', ',', 'where', 'it', 'will', 'just', 'concatenate', 'sequence', 'of', 'bytes', '.'], ['a', 'common', 'interactive', 'use', 'of', ... Read more","og_url":"https:\/\/jassweb.com\/solved\/solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed\/","og_site_name":"JassWeb","article_published_time":"2022-09-21T03:15:25+00:00","author":"Kirat","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kirat","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jassweb.com\/solved\/solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed\/#article","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed\/"},"author":{"name":"Kirat","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31"},"headline":"[Solved] I have some list of lists. I need to make a dictionary from it.Examples below [closed]","datePublished":"2022-09-21T03:15:25+00:00","mainEntityOfPage":{"@id":"https:\/\/jassweb.com\/solved\/solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed\/"},"wordCount":44,"publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"keywords":["python"],"articleSection":["Solved"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jassweb.com\/solved\/solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed\/","url":"https:\/\/jassweb.com\/solved\/solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed\/","name":"[Solved] I have some list of lists. I need to make a dictionary from it.Examples below [closed] - JassWeb","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/#website"},"datePublished":"2022-09-21T03:15:25+00:00","breadcrumb":{"@id":"https:\/\/jassweb.com\/solved\/solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jassweb.com\/solved\/solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jassweb.com\/solved\/solved-i-have-some-list-of-lists-i-need-to-make-a-dictionary-from-it-examples-below-closed\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jassweb.com\/solved\/"},{"@type":"ListItem","position":2,"name":"[Solved] I have some list of lists. I need to make a dictionary from it.Examples below [closed]"}]},{"@type":"WebSite","@id":"https:\/\/jassweb.com\/solved\/#website","url":"https:\/\/jassweb.com\/solved\/","name":"JassWeb","description":"Build High-quality Websites","publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jassweb.com\/solved\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jassweb.com\/solved\/#organization","name":"Jass Web","url":"https:\/\/jassweb.com\/solved\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/","url":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","contentUrl":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","width":693,"height":132,"caption":"Jass Web"},"image":{"@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31","name":"Kirat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/image\/","url":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1776403586","contentUrl":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1776403586","caption":"Kirat"},"sameAs":["http:\/\/jassweb.com"],"url":"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/9908","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/comments?post=9908"}],"version-history":[{"count":0,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/9908\/revisions"}],"wp:attachment":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/media?parent=9908"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/categories?post=9908"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/tags?post=9908"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}