<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://coolscript.net/index.php?action=history&amp;feed=atom&amp;title=Python_cheat_sheet</id>
	<title>Python cheat sheet - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://coolscript.net/index.php?action=history&amp;feed=atom&amp;title=Python_cheat_sheet"/>
	<link rel="alternate" type="text/html" href="https://coolscript.net/index.php?title=Python_cheat_sheet&amp;action=history"/>
	<updated>2026-06-02T18:16:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.1</generator>
	<entry>
		<id>https://coolscript.net/index.php?title=Python_cheat_sheet&amp;diff=1026&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;=Two dimension dictionary with embedded arrays=   #Init Dict  dict = {}  &#039;&#039;&#039;#Inventory for Category Fruits&#039;&#039;&#039;  dict[&#039;1000A&#039;] = {}  dict[&#039;1000A&#039;][&#039;Category&#039;] = &#039;Fruits&#039;  dict[&#039;1000A&#039;][&#039;Items&#039;] = &#039;Orange, Lemmon, Apple&#039;  dict[&#039;1000A&#039;][&#039;Location&#039;] = &#039;New York&#039;  &#039;&#039;&#039;#Inventory for Category Cars&#039;&#039;&#039;  dict[&#039;1000B&#039;] = {}  dict[&#039;1000B&#039;][&#039;Category&#039;] = &#039;Cars&#039;  dict[&#039;1000B&#039;][&#039;Items&#039;] = &#039;Audi, BMW, Mercedes, VW&#039;  dict[&#039;1000B&#039;][&#039;Location&#039;] = &#039;London&#039;  &#039;&#039;&#039;#Inventory for Category Bikes&#039;&#039;...&quot;</title>
		<link rel="alternate" type="text/html" href="https://coolscript.net/index.php?title=Python_cheat_sheet&amp;diff=1026&amp;oldid=prev"/>
		<updated>2024-08-27T21:09:10Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;=Two dimension dictionary with embedded arrays=   #Init Dict  dict = {}  &amp;#039;&amp;#039;&amp;#039;#Inventory for Category Fruits&amp;#039;&amp;#039;&amp;#039;  dict[&amp;#039;1000A&amp;#039;] = {}  dict[&amp;#039;1000A&amp;#039;][&amp;#039;Category&amp;#039;] = &amp;#039;Fruits&amp;#039;  dict[&amp;#039;1000A&amp;#039;][&amp;#039;Items&amp;#039;] = &amp;#039;Orange, Lemmon, Apple&amp;#039;  dict[&amp;#039;1000A&amp;#039;][&amp;#039;Location&amp;#039;] = &amp;#039;New York&amp;#039;  &amp;#039;&amp;#039;&amp;#039;#Inventory for Category Cars&amp;#039;&amp;#039;&amp;#039;  dict[&amp;#039;1000B&amp;#039;] = {}  dict[&amp;#039;1000B&amp;#039;][&amp;#039;Category&amp;#039;] = &amp;#039;Cars&amp;#039;  dict[&amp;#039;1000B&amp;#039;][&amp;#039;Items&amp;#039;] = &amp;#039;Audi, BMW, Mercedes, VW&amp;#039;  dict[&amp;#039;1000B&amp;#039;][&amp;#039;Location&amp;#039;] = &amp;#039;London&amp;#039;  &amp;#039;&amp;#039;&amp;#039;#Inventory for Category Bikes&amp;#039;&amp;#039;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Two dimension dictionary with embedded arrays=&lt;br /&gt;
&lt;br /&gt;
 #Init Dict&lt;br /&gt;
 dict = {}&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;#Inventory for Category Fruits&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 dict[&amp;#039;1000A&amp;#039;] = {}&lt;br /&gt;
 dict[&amp;#039;1000A&amp;#039;][&amp;#039;Category&amp;#039;] = &amp;#039;Fruits&amp;#039;&lt;br /&gt;
 dict[&amp;#039;1000A&amp;#039;][&amp;#039;Items&amp;#039;] = &amp;#039;Orange, Lemmon, Apple&amp;#039;&lt;br /&gt;
 dict[&amp;#039;1000A&amp;#039;][&amp;#039;Location&amp;#039;] = &amp;#039;New York&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;#Inventory for Category Cars&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 dict[&amp;#039;1000B&amp;#039;] = {}&lt;br /&gt;
 dict[&amp;#039;1000B&amp;#039;][&amp;#039;Category&amp;#039;] = &amp;#039;Cars&amp;#039;&lt;br /&gt;
 dict[&amp;#039;1000B&amp;#039;][&amp;#039;Items&amp;#039;] = &amp;#039;Audi, BMW, Mercedes, VW&amp;#039;&lt;br /&gt;
 dict[&amp;#039;1000B&amp;#039;][&amp;#039;Location&amp;#039;] = &amp;#039;London&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;#Inventory for Category Bikes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 dict[&amp;#039;1000C&amp;#039;] = {}&lt;br /&gt;
 dict[&amp;#039;1000C&amp;#039;][&amp;#039;Category&amp;#039;] = &amp;#039;Bikes&amp;#039;&lt;br /&gt;
 dict[&amp;#039;1000C&amp;#039;][&amp;#039;Items&amp;#039;] = &amp;#039;Ducati, KTM, Yamaha, Husquarna&amp;#039;&lt;br /&gt;
 dict[&amp;#039;1000C&amp;#039;][&amp;#039;Location&amp;#039;] = &amp;#039;Frankfurt&amp;#039;&lt;br /&gt;
 #List the dict inventory&lt;br /&gt;
 for pnt in dict:&lt;br /&gt;
    print(&amp;quot;-ID&amp;quot;, pnt)&lt;br /&gt;
    print(&amp;quot;\t-Category&amp;quot;, dict[pnt][&amp;#039;Category&amp;#039;])&lt;br /&gt;
    print(&amp;quot;\t-Location&amp;quot;, dict[pnt][&amp;#039;Location&amp;#039;])&lt;br /&gt;
    print(&amp;quot;\t-Items:&amp;quot;)&lt;br /&gt;
    &amp;#039;&amp;#039;&amp;#039;#Split the dict[pnt][&amp;#039;Items&amp;#039;] string, then strip and map into the set named items&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
    items = map(str.strip, dict[pnt][&amp;#039;Items&amp;#039;].split(&amp;#039;,&amp;#039;)) #items contains now a set of dict[pnt][&amp;#039;Items&amp;#039;]&lt;br /&gt;
    for item in items:&lt;br /&gt;
      print(&amp;quot;\t\t-&amp;quot;, item)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Output==&lt;br /&gt;
&lt;br /&gt;
 -ID 1000A&lt;br /&gt;
        -Category Fruits&lt;br /&gt;
        -Location New York&lt;br /&gt;
        -Items:&lt;br /&gt;
                - Orange&lt;br /&gt;
                - Lemmon&lt;br /&gt;
                - Apple&lt;br /&gt;
 -ID 1000B&lt;br /&gt;
        -Category Cars&lt;br /&gt;
        -Location London&lt;br /&gt;
        -Items:&lt;br /&gt;
                - Audi&lt;br /&gt;
                - BMW&lt;br /&gt;
                - Mercedes&lt;br /&gt;
                - VW&lt;br /&gt;
 -ID 1000C&lt;br /&gt;
        -Category Bikes&lt;br /&gt;
        -Location Frankfurt&lt;br /&gt;
        -Items:&lt;br /&gt;
                - Ducati&lt;br /&gt;
                - KTM&lt;br /&gt;
                - Yamaha&lt;br /&gt;
                - Husquarna&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>