<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://wiki.cedricbonhomme.org/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>cedric's bazaar - cs_lang:python:things-to-know</title>
        <description></description>
        <link>https://wiki.cedricbonhomme.org/</link>
        <lastBuildDate>Tue, 21 Apr 2026 13:49:00 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>https://wiki.cedricbonhomme.org/_media/wiki:dokuwiki.svg</url>
            <title>cedric's bazaar</title>
            <link>https://wiki.cedricbonhomme.org/</link>
        </image>
        <item>
            <title>comprehensions</title>
            <link>https://wiki.cedricbonhomme.org/cs_lang:python:things-to-know:comprehensions?rev=1292175248&amp;do=diff</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;list_comprehensions&quot;&gt;List Comprehensions&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;
&lt;pre class=&quot;code python&quot;&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_list &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;elem * &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; elem &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; a_list&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;18&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_list
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_list &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;elem * &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; elem &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; a_list&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_list
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;18&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;code python&quot;&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;a &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; a &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;99&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; a % &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;14&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;18&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;22&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;24&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;26&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;28&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;34&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;36&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;38&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;40&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;44&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;46&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;48&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;52&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;54&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;56&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;58&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;60&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;62&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;66&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;68&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;70&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;72&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;74&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;76&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;78&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;80&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;82&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;84&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;86&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;88&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;90&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;92&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;94&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;96&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;98&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;a % &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; a &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;99&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;List Comprehensions&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;list_comprehensions&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-1179&amp;quot;} --&gt;
&lt;h1 class=&quot;sectionedit2&quot; id=&quot;dictionary_comprehensions&quot;&gt;Dictionary Comprehensions&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Dictionary Comprehensions&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;dictionary_comprehensions&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;1180-&amp;quot;} --&gt;</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Sun, 12 Dec 2010 17:34:08 +0000</pubDate>
        </item>
        <item>
            <title>date-and-time</title>
            <link>https://wiki.cedricbonhomme.org/cs_lang:python:things-to-know:date-and-time?rev=1340183649&amp;do=diff</link>
            <description>&lt;pre class=&quot;code python&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;time&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;#pattern = &amp;quot;%a %b %d %H:%M:%S  %Y&amp;quot;&lt;/span&gt;
pattern &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'%Y-%m-%d %H:%M:%S'&lt;/span&gt;
date_time &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'2007-02-05 16:15:18'&lt;/span&gt;
&amp;nbsp;
epoch &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;time&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;mktime&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;time&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;strptime&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;date_time&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; pattern&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; epoch&lt;/pre&gt;
&lt;pre class=&quot;code python&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;def&lt;/span&gt; delta_time&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;dt&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; delta&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; fmt&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;'%Y-%m-%d %H:%M:%S'&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&amp;quot;
    Adds a time delta to a datetime object with a specific format.
&amp;nbsp;
    Example of call:
    &amp;gt;&amp;gt;&amp;gt; new_dt = delta_time('2012-10-27 12:05:54', datetime.timedelta(minutes=45))
    &amp;gt;&amp;gt;&amp;gt; print(&amp;quot;%s:%s:%s&amp;quot; % (new_dt.hour, new_dt.minute, new_dt.second))
    12:50:54
    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;datetime&lt;/span&gt;.&lt;span class=&quot;kw3&quot;&gt;datetime&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;*&lt;span class=&quot;kw3&quot;&gt;time&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;strptime&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;dt&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; fmt&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;:&lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; + delta&lt;/pre&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Wed, 20 Jun 2012 09:14:09 +0000</pubDate>
        </item>
        <item>
            <title>exceptions</title>
            <link>https://wiki.cedricbonhomme.org/cs_lang:python:things-to-know:exceptions?rev=1292171344&amp;do=diff</link>
            <description>&lt;pre class=&quot;code python&quot;&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a
Traceback &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;most recent call last&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:
  File &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;lt;stdin&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; line &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;module&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;NameError&lt;/span&gt;: name &lt;span class=&quot;st0&quot;&gt;'a'&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;not&lt;/span&gt; defined&lt;/pre&gt;
&lt;pre class=&quot;code python&quot;&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;try&lt;/span&gt;:
...   &lt;span class=&quot;me1&quot;&gt;a&lt;/span&gt; 
... &lt;span class=&quot;kw1&quot;&gt;except&lt;/span&gt;:
...   &lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;'a' is not defined.&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
... 
&lt;span class=&quot;st0&quot;&gt;'a'&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;not&lt;/span&gt; defined.&lt;/pre&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Sun, 12 Dec 2010 16:29:04 +0000</pubDate>
        </item>
        <item>
            <title>files</title>
            <link>https://wiki.cedricbonhomme.org/cs_lang:python:things-to-know:files?rev=1292178062&amp;do=diff</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;reading_a_file&quot;&gt;Reading a file&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Reading a file&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;reading_a_file&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-30&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit2&quot; id=&quot;line_by_line&quot;&gt;Line by line&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;pre class=&quot;code python&quot;&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; line &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;./dico.txt&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;r&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:
...   &lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;line&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
... 
&lt;span class=&quot;me1&quot;&gt;ABACA&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;~&lt;/span&gt;
&amp;nbsp;
ABACULE&lt;span class=&quot;sy0&quot;&gt;~&lt;/span&gt;
&amp;nbsp;
ABAISSABLE&lt;span class=&quot;sy0&quot;&gt;~&lt;/span&gt;
&amp;nbsp;
ABAISSAIENT&lt;span class=&quot;sy0&quot;&gt;~&lt;/span&gt;
&amp;nbsp;
ABAISSAIS&lt;span class=&quot;sy0&quot;&gt;~&lt;/span&gt;
.
.
.&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Line by line&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;line_by_line&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;31-204&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit3&quot; id=&quot;classic_method&quot;&gt;Classic method&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;pre class=&quot;code python&quot;&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_file &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;None&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;try&lt;/span&gt;:              
...   &lt;span class=&quot;me1&quot;&gt;a_file&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;./dico.txt&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;r&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
...   &lt;span class=&quot;me1&quot;&gt;text&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; a_file.&lt;span class=&quot;me1&quot;&gt;read&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
... &lt;span class=&quot;kw1&quot;&gt;except&lt;/span&gt;:
...   &lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;Error&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
... &lt;span class=&quot;kw1&quot;&gt;finally&lt;/span&gt;:
...   &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; a_file &lt;span class=&quot;sy0&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;None&lt;/span&gt;:
...     &lt;span class=&quot;me1&quot;&gt;a_file&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;close&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
... 
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_file
&lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;_io.&lt;span class=&quot;me1&quot;&gt;TextIOWrapper&lt;/span&gt; name&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;'./dico.txt'&lt;/span&gt; encoding&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;'UTF-8'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_file.&lt;span class=&quot;me1&quot;&gt;name&lt;/span&gt;
&lt;span class=&quot;st0&quot;&gt;'./dico.txt'&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Classic method&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;classic_method&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;205-561&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit4&quot; id=&quot;the_with_statement&quot;&gt;The with statement&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
The better solution. No need to use &lt;strong&gt;try: … except: …&lt;/strong&gt;.&lt;br/&gt;

Forget the previous method.
&lt;/p&gt;
&lt;pre class=&quot;code python&quot;&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;./dico.txt&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;r&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;as&lt;/span&gt; f:
...   &lt;span class=&quot;me1&quot;&gt;text&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; f.&lt;span class=&quot;me1&quot;&gt;read&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;text&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;2664170&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;text&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
.
.
.
&lt;span class=&quot;me1&quot;&gt;ZYGOMORPHE&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;~&lt;/span&gt;
ZYGOMYCETES&lt;span class=&quot;sy0&quot;&gt;~&lt;/span&gt;
ZYGOMYCETE&lt;span class=&quot;sy0&quot;&gt;~&lt;/span&gt;
ZYGOPETALE&lt;span class=&quot;sy0&quot;&gt;~&lt;/span&gt;
ZYGOTE&lt;span class=&quot;sy0&quot;&gt;~&lt;/span&gt;
ZYMASE&lt;span class=&quot;sy0&quot;&gt;~&lt;/span&gt;
ZYMOTECHNIE&lt;span class=&quot;sy0&quot;&gt;~&lt;/span&gt;
ZYMOTIQUE&lt;span class=&quot;sy0&quot;&gt;~&lt;/span&gt;
ZYTHON&lt;span class=&quot;sy0&quot;&gt;~&lt;/span&gt;
ZYTHUM&lt;span class=&quot;sy0&quot;&gt;~&lt;/span&gt;
Z&lt;span class=&quot;sy0&quot;&gt;~&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
This code calls open(), but it never calls a_file.close(). The with statement starts a code block, like an if statement or a for loop. Inside this code block, you can use the variable a_file as the stream object returned from the call to open(). All the regular stream object methods are available — seek(), read(), whatever you need. When the with block ends, Python calls a_file.close() automatically.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;The with statement&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;the_with_statement&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;562-&amp;quot;} --&gt;</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Sun, 12 Dec 2010 18:21:02 +0000</pubDate>
        </item>
        <item>
            <title>geographic</title>
            <link>https://wiki.cedricbonhomme.org/cs_lang:python:things-to-know:geographic?rev=1340184064&amp;do=diff</link>
            <description>&lt;pre class=&quot;code python&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;def&lt;/span&gt; Deg2Rad&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&amp;quot;
    Degrees to radians.
    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; x * &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;math&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;pi&lt;/span&gt;/&lt;span class=&quot;nu0&quot;&gt;180&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;def&lt;/span&gt; Rad2Deg&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&amp;quot;
    Radians to degress.
    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; x * &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;180&lt;/span&gt;/&lt;span class=&quot;kw3&quot;&gt;math&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;pi&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;def&lt;/span&gt; CalcRad&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lat&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&amp;quot;
    Radius of curvature in meters at specified latitude.
    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    a &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;6378.137&lt;/span&gt;
    e2 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0.081082&lt;/span&gt; * &lt;span class=&quot;nu0&quot;&gt;0.081082&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;# the radius of curvature of an ellipsoidal Earth in the plane of a&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;# meridian of latitude is given by&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;#&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;# R' = a * (1 - e^2) / (1 - e^2 * (sin(lat))^2)^(3/2)&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;#&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;# where a is the equatorial radius,&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;# b is the polar radius, and&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;# e is the eccentricity of the ellipsoid = sqrt(1 - b^2/a^2)&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;#&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;# a = 6378 km (3963 mi) Equatorial radius (surface to center distance)&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;# b = 6356.752 km (3950 mi) Polar radius (surface to center distance)&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;# e = 0.081082 Eccentricity&lt;/span&gt;
    sc &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;math&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;sin&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Deg2Rad&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lat&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    x &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; a * &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1.0&lt;/span&gt; - e2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    z &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1.0&lt;/span&gt; - e2 * sc * sc
    y &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;pow&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;z&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1.5&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    r &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; x / y
&amp;nbsp;
    r &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; r * &lt;span class=&quot;nu0&quot;&gt;1000.0&lt;/span&gt;      &lt;span class=&quot;co1&quot;&gt;# Convert to meters&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; r
&amp;nbsp;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;def&lt;/span&gt; EarthDistance&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lat1&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; lon1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lat2&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; lon2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&amp;quot;
    Distance in meters between two points specified in degrees.
    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    x1 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; CalcRad&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lat1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; * &lt;span class=&quot;kw3&quot;&gt;math&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;cos&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Deg2Rad&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lon1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; * &lt;span class=&quot;kw3&quot;&gt;math&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;sin&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Deg2Rad&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;90&lt;/span&gt;-lat1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    x2 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; CalcRad&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lat2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; * &lt;span class=&quot;kw3&quot;&gt;math&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;cos&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Deg2Rad&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lon2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; * &lt;span class=&quot;kw3&quot;&gt;math&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;sin&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Deg2Rad&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;90&lt;/span&gt;-lat2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    y1 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; CalcRad&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lat1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; * &lt;span class=&quot;kw3&quot;&gt;math&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;sin&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Deg2Rad&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lon1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; * &lt;span class=&quot;kw3&quot;&gt;math&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;sin&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Deg2Rad&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;90&lt;/span&gt;-lat1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    y2 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; CalcRad&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lat2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; * &lt;span class=&quot;kw3&quot;&gt;math&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;sin&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Deg2Rad&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lon2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; * &lt;span class=&quot;kw3&quot;&gt;math&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;sin&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Deg2Rad&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;90&lt;/span&gt;-lat2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    z1 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; CalcRad&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lat1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; * &lt;span class=&quot;kw3&quot;&gt;math&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;cos&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Deg2Rad&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;90&lt;/span&gt;-lat1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    z2 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; CalcRad&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lat2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; * &lt;span class=&quot;kw3&quot;&gt;math&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;cos&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Deg2Rad&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;90&lt;/span&gt;-lat2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    a &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;x1*x2 + y1*y2 + z1*z2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;/&lt;span class=&quot;kw2&quot;&gt;pow&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;CalcRad&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lat1+lat2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;/&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;# a should be in [1, -1] but can sometimes fall outside it by&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;# a very small amount due to rounding errors in the preceding&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;# calculations (this is prone to happen when the argument points&lt;/span&gt;
    &lt;span class=&quot;co1&quot;&gt;# are very close together).  Thus we constrain it here.&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;abs&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;:
        a &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;elif&lt;/span&gt; a &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; -&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;:
        a &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; -&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; CalcRad&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lat1+lat2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; / &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; * &lt;span class=&quot;kw3&quot;&gt;math&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;acos&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;def&lt;/span&gt; MeterOffset&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lat1&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; lon1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lat2&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; lon2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:
    &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&amp;quot;
    Return offset in meters of second arg from first.
    &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    dx &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; EarthDistance&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lat1&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; lon1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lat1&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; lon2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    dy &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; EarthDistance&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lat1&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; lon1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;lat2&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; lon1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; lat1 &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; lat2:
        dy *&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; -&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; lon1 &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; lon2:
        dx *&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; -&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;dx&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; dy&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Wed, 20 Jun 2012 09:21:04 +0000</pubDate>
        </item>
        <item>
            <title>installation</title>
            <link>https://wiki.cedricbonhomme.org/cs_lang:python:things-to-know:installation?rev=1474363309&amp;do=diff</link>
            <description>&lt;pre class=&quot;code bash&quot;&gt;$ &lt;span class=&quot;kw2&quot;&gt;wget&lt;/span&gt; https:&lt;span class=&quot;sy0&quot;&gt;//&lt;/span&gt;www.python.org&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;ftp&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;python&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;3.5.2&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;Python-3.5.2.tar.xz
$ &lt;span class=&quot;kw2&quot;&gt;tar&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-xf&lt;/span&gt; Python-3.5.2.tar.xz
$ &lt;span class=&quot;kw2&quot;&gt;rm&lt;/span&gt; Python-3.5.2.tar.xz
$ &lt;span class=&quot;kw3&quot;&gt;cd&lt;/span&gt; Python-3.5.2&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;
$ &lt;span class=&quot;kw3&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;re2&quot;&gt;LD_RUN_PATH&lt;/span&gt;=&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;usr&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;local&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;lib&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;
$ .&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;configure &lt;span class=&quot;re5&quot;&gt;--enable-loadable-sqlite-extensions&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;--enable-shared&lt;/span&gt;
$ &lt;span class=&quot;kw2&quot;&gt;make&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# make install&lt;/span&gt;
$ &lt;span class=&quot;kw3&quot;&gt;cd&lt;/span&gt; ..
$ &lt;span class=&quot;kw2&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-Rf&lt;/span&gt; Python-3.5.2&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
This is how I install Python on my Debian system. With shared libraries enabled and SQLite support.&lt;br/&gt;

SSL is supposed to be enabled by default with Python3.
&lt;/p&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 20 Sep 2016 09:21:49 +0000</pubDate>
        </item>
        <item>
            <title>lazy-vs-eager</title>
            <link>https://wiki.cedricbonhomme.org/cs_lang:python:things-to-know:lazy-vs-eager?rev=1358949715&amp;do=diff</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;lazy_vs_eager_evaluation&quot;&gt;Lazy vs Eager evaluation&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
Python generally uses an eager evaluation (in contrary to &lt;a href=&quot;https://wiki.cedricbonhomme.org/cs_lang:haskell&quot; class=&quot;wikilink1&quot; title=&quot;cs_lang:haskell&quot; data-wiki-id=&quot;cs_lang:haskell&quot;&gt;Haskell&lt;/a&gt;) but for example with Python 3 the range() function returns a special range object which computes elements of the list on demand.
&lt;/p&gt;
&lt;pre class=&quot;code python&quot;&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; r &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;r&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;r&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
This was not the case with Python 2 (without iterators):
&lt;/p&gt;
&lt;pre class=&quot;code python&quot;&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; r &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; r
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; r&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Lazy evaluation saves execution time for large ranges.
&lt;/p&gt;

&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Wed, 23 Jan 2013 14:01:55 +0000</pubDate>
        </item>
        <item>
            <title>native-datatypes</title>
            <link>https://wiki.cedricbonhomme.org/cs_lang:python:things-to-know:native-datatypes?rev=1294752390&amp;do=diff</link>
            <description>&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Booleans&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Numbers&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Strings&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Bytes&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Lists&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Tuples&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Sets&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Dictionaries&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 class=&quot;sectionedit1&quot; id=&quot;booleans&quot;&gt;Booleans&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;
&lt;pre class=&quot;code python&quot;&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; x &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;42&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;19&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;lt;=&lt;/span&gt; x &lt;span class=&quot;sy0&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;51&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;19&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;lt;=&lt;/span&gt; x &lt;span class=&quot;sy0&quot;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;41&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt; + &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt; + &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt; * &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt; / &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;
Traceback &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;most recent call last&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:
  File &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;lt;stdin&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; line &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;module&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;ZeroDivisionError&lt;/span&gt;: &lt;span class=&quot;kw2&quot;&gt;int&lt;/span&gt; division &lt;span class=&quot;kw1&quot;&gt;or&lt;/span&gt; modulo by zero&lt;/pre&gt;
&lt;pre class=&quot;code python&quot;&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;import&lt;/span&gt; this
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; love &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; this
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; this &lt;span class=&quot;kw1&quot;&gt;is&lt;/span&gt; love
&lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; love &lt;span class=&quot;kw1&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; love &lt;span class=&quot;kw1&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; love &lt;span class=&quot;kw1&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; love &lt;span class=&quot;kw1&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; love &lt;span class=&quot;kw1&quot;&gt;is&lt;/span&gt; love
&lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Booleans&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;booleans&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;97-679&amp;quot;} --&gt;
&lt;h1 class=&quot;sectionedit2&quot; id=&quot;numbers&quot;&gt;Numbers&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;
&lt;pre class=&quot;code python&quot;&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'int'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;isinstance&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; + &lt;span class=&quot;nu0&quot;&gt;1.0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'float'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;2.0&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2.5&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; 
&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;-&lt;span class=&quot;nu0&quot;&gt;2.5&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
-&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1.12345678901234567890&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1.1234567890123457&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1000000000000000000000&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'int'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;code python&quot;&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;11&lt;/span&gt; /&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;5.5&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; // &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;   
&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; -&lt;span class=&quot;nu0&quot;&gt;11&lt;/span&gt; // &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;
-&lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;11.0&lt;/span&gt; // &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;5.0&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;11&lt;/span&gt; ** &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;121&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;11&lt;/span&gt; % &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Numbers&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;numbers&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;680-1095&amp;quot;} --&gt;
&lt;h1 class=&quot;sectionedit3&quot; id=&quot;lists&quot;&gt;Lists&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;
&lt;pre class=&quot;code python&quot;&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_list &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;a&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Python&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3.6465&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_list&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;st0&quot;&gt;'a'&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_list&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;-&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;3.6465&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_list&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;:&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;'a'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_list&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;:&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'Python'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3.6465&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_list&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;:&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'Python'&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; c &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; a_list&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;:&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; + a_list&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;:&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; c
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;'a'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'Python'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3.6465&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; d &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; a_list&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;:&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; d
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;'a'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'Python'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3.6465&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;code python&quot;&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_list &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;a&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Python&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3.6465&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_list.&lt;span class=&quot;me1&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;Toto&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_list
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;'a'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'Python'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3.6465&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'Toto'&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_list.&lt;span class=&quot;me1&quot;&gt;extend&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_list
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;'a'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'Python'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3.6465&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'Toto'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_list.&lt;span class=&quot;me1&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'Ω'&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;      
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_list
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;'Ω'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'a'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'Python'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3.6465&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'Toto'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_list.&lt;span class=&quot;me1&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_list
&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;'Ω'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'a'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'Python'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3.6465&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'Toto'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;len&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;a_list&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_list&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;-&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Lists&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;lists&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:4,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;1096-1999&amp;quot;} --&gt;
&lt;h1 class=&quot;sectionedit4&quot; id=&quot;dictionaries&quot;&gt;Dictionaries&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;
&lt;pre class=&quot;code python&quot;&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_dict &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;'server'&lt;/span&gt;: &lt;span class=&quot;st0&quot;&gt;'cedricbonhomme.org'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'database'&lt;/span&gt;:&lt;span class=&quot;st0&quot;&gt;'mysql'&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_dict&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;'blog'&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
Traceback &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;most recent call last&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:
  File &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;lt;stdin&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; line &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;module&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;KeyError&lt;/span&gt;: &lt;span class=&quot;st0&quot;&gt;'blog'&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'blog'&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; a_dict
&lt;span class=&quot;kw2&quot;&gt;False&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_dict&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;'blog'&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'wordpress'&lt;/span&gt; 
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_dict
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;'blog'&lt;/span&gt;: &lt;span class=&quot;st0&quot;&gt;'dotclear'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'database'&lt;/span&gt;: &lt;span class=&quot;st0&quot;&gt;'mysql'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'server'&lt;/span&gt;: &lt;span class=&quot;st0&quot;&gt;'cedricbonhomme.org'&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_dict.&lt;span class=&quot;me1&quot;&gt;keys&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
dict_keys&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;'blog'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'database'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'server'&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; a_dict.&lt;span class=&quot;me1&quot;&gt;values&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
dict_values&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;'dotclear'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'mysql'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;'cedricbonhomme.org'&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Dictionaries&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;dictionaries&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:6,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;2000-&amp;quot;} --&gt;</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 11 Jan 2011 13:26:30 +0000</pubDate>
        </item>
    </channel>
</rss>
