<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Dict on SourFox</title>
    <link>https://sourfox.khmersite.net/tags/dict/</link>
    <description>Recent content in Dict on SourFox</description>
    <image>
      <title>SourFox</title>
      <url>https://sourfox.khmersite.net/papermod-cover.png</url>
      <link>https://sourfox.khmersite.net/papermod-cover.png</link>
    </image>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Wed, 15 Nov 2023 20:31:21 +1100</lastBuildDate>
    <atom:link href="https://sourfox.khmersite.net/tags/dict/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Check if a Key Is in a Dictionary</title>
      <link>https://sourfox.khmersite.net/p/2023/11/check-if-a-key-is-in-a-dictionary/</link>
      <pubDate>Wed, 15 Nov 2023 20:31:21 +1100</pubDate>
      <guid>https://sourfox.khmersite.net/p/2023/11/check-if-a-key-is-in-a-dictionary/</guid>
      <description>&lt;p&gt;&lt;em&gt;The next one I&amp;rsquo;ll actually explain thoroughly.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;So I had enough time to make another program. This time I had to meet the condtitions:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Write a Python program that checks if a key exists in a dictionary or not.
 
If the key exists in the dictionary, print True. Else, print False.

The key should be stored in the variable key.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here is how I did it:&lt;/p&gt;
&lt;p&gt;Input:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;dict = {&amp;#34;toy&amp;#34;: &amp;#34;dino&amp;#34;, &amp;#34;sport&amp;#34;: &amp;#34;soccer&amp;#34;, &amp;#34;food&amp;#34;: &amp;#34;ramen&amp;#34;}
key = &amp;#34;toy&amp;#34;
if key in dict:
    print(True)
else:
    print(False)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Output:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
