<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>devkuma – Python</title>
    <link>https://www.devkuma.com/en/tags/python/</link>
    <image>
      <url>https://www.devkuma.com/en/tags/python/logo/180x180.jpg</url>
      <title>Python</title>
      <link>https://www.devkuma.com/en/tags/python/</link>
    </image>
    <description>Recent content in Python on devkuma</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <managingEditor>kc@example.com (kc kim)</managingEditor>
    <webMaster>kc@example.com (kc kim)</webMaster>
    <copyright>The devkuma</copyright>
    
	  <atom:link href="https://www.devkuma.com/en/tags/python/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Introduction to Python | Python Development Environment</title>
      <link>https://www.devkuma.com/en/docs/python/python-%EA%B0%9C%EB%B0%9C-%ED%99%98%EA%B2%BD/</link>
      <pubDate>Wed, 20 Sep 2017 00:31:23 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/python/python-%EA%B0%9C%EB%B0%9C-%ED%99%98%EA%B2%BD/</guid>
      <description>
        
        
        &lt;p&gt;First, this section summarizes the basic Python knowledge required to use GAE. It will help you understand the concept of what Python is.&lt;/p&gt;

      </description>
      
      <category>Python</category>
      
    </item>
    
    <item>
      <title>Python Introduction | Python Development Environment | Starting IDLE</title>
      <link>https://www.devkuma.com/en/docs/python/idle/</link>
      <pubDate>Wed, 20 Sep 2017 00:31:23 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/python/idle/</guid>
      <description>
        
        
        &lt;h2 id=&#34;starting-idle&#34;&gt;Starting IDLE&lt;/h2&gt;
&lt;p&gt;Now let us start using Python. The Python program itself is simply an interpreter, a command-line program without a GUI. Python also includes a simple tool called IDLE. We will use it to run Python.&lt;/p&gt;
&lt;p&gt;On Windows, find the &amp;ldquo;Python 3&amp;rdquo; shortcut from the Start menu and select &amp;ldquo;IDLE.&amp;rdquo; On macOS, launch IDLE from the &amp;ldquo;Python 3&amp;rdquo; folder installed in the Applications folder.&lt;/p&gt;
&lt;p&gt;IDLE is a very simple tool that resembles a text editor, and it can be used as one. Its distinguishing feature is an &amp;ldquo;interactive shell.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;An interactive shell lets you run Python interactively. Enter a Python statement in IDLE and press Enter or Return to display the result immediately. You can check how Python behaves by executing statements one at a time.&lt;/p&gt;
&lt;p&gt;In the open IDLE window, enter the following statement and press Enter or Return.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87&#34;&gt;print&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;Hello Python!&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The text &amp;ldquo;Hello Python!&amp;rdquo; appears on the next line.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://www.devkuma.com/docs/python/idle.png&#34; alt=&#34;IDLE&#34;&gt;&lt;/p&gt;
&lt;p&gt;You can work by repeatedly running Python code and reviewing the results. This interactive shell is particularly useful when you begin learning Python.&lt;/p&gt;

      </description>
      
      <category>Python</category>
      
    </item>
    
    <item>
      <title>Introduction to Python | Values and Calculations</title>
      <link>https://www.devkuma.com/en/docs/python/calculate-value/</link>
      <pubDate>Wed, 20 Sep 2017 00:31:23 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/python/calculate-value/</guid>
      <description>
        
        
        &lt;p&gt;The basics of programming begin with values and calculations. This section explains basic values and calculation methods used in Python.&lt;/p&gt;

      </description>
      
      <category>Python</category>
      
    </item>
    
    <item>
      <title>Introduction to Python | Statements</title>
      <link>https://www.devkuma.com/en/docs/python/statement/</link>
      <pubDate>Wed, 20 Sep 2017 00:31:23 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/python/statement/</guid>
      <description>
        
        
        &lt;p&gt;One of Python&amp;rsquo;s most distinctive features is its statement style. This section explains how to write statements with indentation and introduces basic control statements.&lt;/p&gt;

      </description>
      
      <category>Python</category>
      
    </item>
    
    <item>
      <title>Python Introduction | Statements | Relationship Between Statements and Indentation</title>
      <link>https://www.devkuma.com/en/docs/python/statement-indentation/</link>
      <pubDate>Wed, 20 Sep 2017 00:31:23 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/python/statement-indentation/</guid>
      <description>
        
        
        &lt;h2 id=&#34;relationship-between-statements-and-indentation&#34;&gt;Relationship Between Statements and Indentation&lt;/h2&gt;
&lt;p&gt;Values and operations are fundamental to programming languages. Another important concept is control.&lt;/p&gt;
&lt;p&gt;Executing commands only in order supports a limited set of programs. More complex programs control their flow according to the situation, such as executing a process only under certain conditions or repeating it a specified number of times.&lt;/p&gt;
&lt;p&gt;Statements provide instructions for controlling program behavior. Statements designed to control the flow of a program are called control statements.&lt;/p&gt;
&lt;p&gt;Python syntax has a distinctive feature: indentation. Indentation moves the beginning of a line to the right with spaces or tabs.&lt;/p&gt;
&lt;p&gt;Python uses indentation to define blocks in many statements. If a statement means &amp;ldquo;perform the following process in this case,&amp;rdquo; the process is indented to the right. Lines at that indentation level belong to the statement.&lt;/p&gt;
&lt;p&gt;To finish the block, return the indentation to its previous position. Python recognizes the statement to which a line belongs based on where the line begins.&lt;/p&gt;
&lt;p&gt;The following outline illustrates this structure.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Writing Python Statements&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;ordinary&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;statement&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;......&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;statement&lt;/span&gt; &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;     &lt;span style=&#34;color:#000&#34;&gt;process&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;for&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;statement&lt;/span&gt; &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;1&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;......&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;     &lt;span style=&#34;color:#000&#34;&gt;process&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;for&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;statement&lt;/span&gt; &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;1&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;......&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;     &lt;span style=&#34;color:#000&#34;&gt;nested&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;statement&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;inside&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;statement&lt;/span&gt; &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;         &lt;span style=&#34;color:#000&#34;&gt;process&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;for&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;the&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;nested&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;statement&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;......&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;         &lt;span style=&#34;color:#000&#34;&gt;process&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;for&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;the&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;nested&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;statement&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;......&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;     &lt;span style=&#34;color:#000&#34;&gt;process&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;for&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;statement&lt;/span&gt; &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;1&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;......&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;statement&lt;/span&gt; &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;     &lt;span style=&#34;color:#000&#34;&gt;process&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;for&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;statement&lt;/span&gt; &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;2&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;......&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;ordinary&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;statement&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;ordinary&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;statement&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;......&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;omitted&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;......&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Statements are structured by changing the starting position of each line. Incorrect indentation can cause a syntax error.&lt;/p&gt;
&lt;p&gt;Python code generally uses spaces instead of tabs for indentation. The exact width is not part of the syntax, but four spaces are widely used. Consistency is important.&lt;/p&gt;
&lt;p&gt;If indentation is too narrow, the structure becomes difficult to read and mistakes become easier to make. If it is too wide, lines quickly move far to the right. Choose a practical width and apply it consistently.&lt;/p&gt;

      </description>
      
      <category>Python</category>
      
    </item>
    
    <item>
      <title>Python Introduction | Statements | Repeating with a while Condition</title>
      <link>https://www.devkuma.com/en/docs/python/%EC%A1%B0%EA%B1%B4%EC%97%90%EC%84%9C-%EB%B0%98%EB%B3%B5-while-%EB%AC%B8/</link>
      <pubDate>Wed, 20 Sep 2017 00:31:23 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/python/%EC%A1%B0%EA%B1%B4%EC%97%90%EC%84%9C-%EB%B0%98%EB%B3%B5-while-%EB%AC%B8/</guid>
      <description>
        
        
        &lt;p&gt;Another important control structure is repetition. Python provides two looping statements. The first is &lt;code&gt;while&lt;/code&gt;, which checks a condition.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Basic while Statement 1&lt;/strong&gt;&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;while condition:
    repeated process ......
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Basic while Statement 2&lt;/strong&gt;&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;while condition:
    repeated process ......
else:
    process after the loop ......
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The condition works like the condition in an &lt;code&gt;if&lt;/code&gt; statement. It is an expression, variable, or value evaluated as &lt;code&gt;True&lt;/code&gt; or &lt;code&gt;False&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;A &lt;code&gt;while&lt;/code&gt; statement checks its condition and repeatedly executes its body while the condition is &lt;code&gt;True&lt;/code&gt;. When the condition becomes &lt;code&gt;False&lt;/code&gt;, the loop ends and execution continues. If an &lt;code&gt;else&lt;/code&gt; block is present, Python executes it when the loop finishes.&lt;/p&gt;
&lt;p&gt;Consider the following example.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;x = 100
count = 1
total = 0
while count &amp;lt;= x: 
    total = total + count 
    count = count + 1
else: 
    print(str(x) + &amp;#34;까지 합계는 &amp;#34; + str(total) +&amp;#34;이다.&amp;#34;) 
print(&amp;#34;.....end.&amp;#34;)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This example calculates and displays the sum from &lt;code&gt;1&lt;/code&gt; through &lt;code&gt;x&lt;/code&gt;. Change the value of &lt;code&gt;x&lt;/code&gt; and inspect the results.&lt;/p&gt;
&lt;p&gt;The condition is &lt;code&gt;while count &amp;lt;= x:&lt;/code&gt;. The loop continues while &lt;code&gt;count&lt;/code&gt; is less than or equal to &lt;code&gt;x&lt;/code&gt; and ends when &lt;code&gt;count&lt;/code&gt; becomes greater than &lt;code&gt;x&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The value of &lt;code&gt;count&lt;/code&gt; must increase during the loop. Otherwise, the &lt;code&gt;while&lt;/code&gt; loop never finishes. This is called an infinite loop. When using &lt;code&gt;while&lt;/code&gt;, consider both the condition and how values change during repetition.&lt;/p&gt;

      </description>
      
      <category>Python</category>
      
    </item>
    
    <item>
      <title>Python Introduction | Statements | Repeating Values in Order with for</title>
      <link>https://www.devkuma.com/en/docs/python/%EB%A7%8E%EC%9D%80-%EA%B0%92%EC%9D%84-%EC%88%9C%EC%84%9C%EB%8C%80%EB%A1%9C-%EB%B0%98%EB%B3%B5%ED%95%98%EB%8A%94-for%EA%B5%AC%EB%AC%B8/</link>
      <pubDate>Wed, 20 Sep 2017 00:31:23 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/python/%EB%A7%8E%EC%9D%80-%EA%B0%92%EC%9D%84-%EC%88%9C%EC%84%9C%EB%8C%80%EB%A1%9C-%EB%B0%98%EB%B3%B5%ED%95%98%EB%8A%94-for%EA%B5%AC%EB%AC%B8/</guid>
      <description>
        
        
        &lt;p&gt;Python has another looping statement: &lt;code&gt;for&lt;/code&gt;. Use &lt;code&gt;for&lt;/code&gt; to process many values in order.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Basic for Statement 1&lt;/strong&gt;&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;for variable in values:
    repeated process ......
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Basic for Statement 2&lt;/strong&gt;&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;for variable in values:
    repeated process ......
else:
    process after the loop
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Programming languages provide ways to group many values together. A &lt;code&gt;for&lt;/code&gt; statement is designed for iterating over such collections. It retrieves each available value in order and performs a process for each one.&lt;/p&gt;
&lt;p&gt;The following example rewrites the &lt;code&gt;while&lt;/code&gt; loop from the previous article as a &lt;code&gt;for&lt;/code&gt; loop.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;x&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;100&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;total&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;for&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;n&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;in&lt;/span&gt; &lt;span style=&#34;color:#204a87&#34;&gt;range&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;1&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;x&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;1&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;):&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#000&#34;&gt;total&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;total&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;n&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;else&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#204a87&#34;&gt;print&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#204a87&#34;&gt;str&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;x&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;까지의 합계는 &amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#204a87&#34;&gt;str&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;total&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;))&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87&#34;&gt;print&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;....end.&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;range(...)&lt;/code&gt; function creates a collection of the numbers from &lt;code&gt;1&lt;/code&gt; through &lt;code&gt;x&lt;/code&gt;. The loop retrieves the numbers &lt;code&gt;1, 2, 3, ... 100&lt;/code&gt; one at a time and adds them to &lt;code&gt;total&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The important question is what a collection of many values is. It is generally called an array. The following articles explain arrays and related features.&lt;/p&gt;

      </description>
      
      <category>Python</category>
      
    </item>
    
    <item>
      <title>Introduction to Python | Lists, Tuples, Ranges, Sets, and Dictionaries</title>
      <link>https://www.devkuma.com/en/docs/python/%EB%A6%AC%EC%8A%A4%ED%8A%B8-%ED%8A%9C%ED%94%8C-%EB%A0%88%EC%9D%B8%EC%A7%80-%EC%84%B8%ED%8A%B8-%EC%82%AC%EC%A0%84/</link>
      <pubDate>Wed, 20 Sep 2017 00:31:23 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/python/%EB%A6%AC%EC%8A%A4%ED%8A%B8-%ED%8A%9C%ED%94%8C-%EB%A0%88%EC%9D%B8%EC%A7%80-%EC%84%B8%ED%8A%B8-%EC%82%AC%EC%A0%84/</guid>
      <description>
        
        
        &lt;p&gt;Python includes several containers for handling multiple values. This section explains their basic usage.&lt;/p&gt;

      </description>
      
      <category>Python</category>
      
    </item>
    
    <item>
      <title>Python Introduction | Lists, Tuples, Ranges, Sets, and Dictionaries | Arrays and Lists</title>
      <link>https://www.devkuma.com/en/docs/python/%EB%B0%B0%EC%97%B4-%EB%A6%AC%EC%8A%A4%ED%8A%B8/</link>
      <pubDate>Wed, 20 Sep 2017 00:31:23 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/python/%EB%B0%B0%EC%97%B4-%EB%A6%AC%EC%8A%A4%ED%8A%B8/</guid>
      <description>
        
        
        &lt;p&gt;Most programming languages provide a special variable-like feature for grouping many values together. It is generally called an array. An array manages values by number. For example, you can change value number &lt;code&gt;1&lt;/code&gt; or retrieve value number &lt;code&gt;3&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Python provides this feature with a list. Write a list as follows.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;variable = [value1, value2, ...]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Write comma-separated values inside square brackets. This creates an ordered list whose values have numbers called indexes.&lt;/p&gt;
&lt;p&gt;The important point is that indexes start at &lt;code&gt;0&lt;/code&gt;. The first value is number &lt;code&gt;0&lt;/code&gt;, the second is number &lt;code&gt;1&lt;/code&gt;, and the third is number &lt;code&gt;2&lt;/code&gt;. A list containing ten values has indexes from &lt;code&gt;0&lt;/code&gt; through &lt;code&gt;9&lt;/code&gt;, not &lt;code&gt;1&lt;/code&gt; through &lt;code&gt;10&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;To access an individual list element, write &lt;code&gt;variable[number]&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;arr[0] = &amp;#34;OK&amp;#34;
val = arr[1]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This syntax lets you change or retrieve the element at a specified index.&lt;/p&gt;
&lt;p&gt;Consider the following example.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;arr = [&amp;#39;hello&amp;#39;,&amp;#39;welcome&amp;#39;,&amp;#39;good-bye&amp;#39;]
for n in arr:
    print(n)
 
print(&amp;#34;....end.&amp;#34;)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This code uses the previously introduced &lt;code&gt;for ... in ...&lt;/code&gt; syntax to iterate over every list element.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;for variable in list:
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The loop retrieves each value from the list in order and assigns it to the variable. Lists and &lt;code&gt;for&lt;/code&gt; statements are frequently used together, so remember both.&lt;/p&gt;

      </description>
      
      <category>Python</category>
      
    </item>
    
    <item>
      <title>Python</title>
      <link>https://www.devkuma.com/en/docs/python/</link>
      <pubDate>Wed, 20 Sep 2017 00:31:23 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/python/</guid>
      <description>
        
        
        &lt;p&gt;&lt;img src=&#34;https://www.devkuma.com/docs/python/python.jpg&#34; alt=&#34;Python&#34;&gt;&lt;/p&gt;
&lt;p&gt;Python is a scripting language that anyone can start learning quickly, like PHP and Ruby. Its popularity has increased recently with fields such as AI development. This guide explains the fundamentals.&lt;/p&gt;

      </description>
      
      <category>Python</category>
      
    </item>
    
    <item>
      <title>Python Introduction | Lists, Tuples, Ranges, Sets, and Dictionaries | Relationship Between Lists and Text</title>
      <link>https://www.devkuma.com/en/docs/python/%EB%A6%AC%EC%8A%A4%ED%8A%B8%EC%99%80-%ED%85%8D%EC%8A%A4%ED%8A%B8%EC%9D%98-%EA%B4%80%EA%B3%84/</link>
      <pubDate>Wed, 20 Sep 2017 00:31:23 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/python/%EB%A6%AC%EC%8A%A4%ED%8A%B8%EC%99%80-%ED%85%8D%EC%8A%A4%ED%8A%B8%EC%9D%98-%EA%B4%80%EA%B3%84/</guid>
      <description>
        
        
        &lt;p&gt;Lists are used in many places, including one that may be unexpected: text.&lt;/p&gt;
&lt;p&gt;In Python, a text value can be handled as a list of characters. For example, the text &lt;code&gt;&amp;quot;Hello&amp;quot;&lt;/code&gt; can be thought of as the following list of five characters.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;str = [&amp;#39;H&amp;#39;, &amp;#39;e&amp;#39;, &amp;#39;l&amp;#39;, &amp;#39;l&amp;#39;, &amp;#39;o&amp;#39;]
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;For example, &lt;code&gt;str[0]&lt;/code&gt; retrieves the character &lt;code&gt;&#39;H&#39;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This works only when retrieving characters. You cannot change characters in a string in the same way. Text and lists are not the same thing. Python simply lets you use list-like access to retrieve characters from text. This also makes it easy to search characters in a string.&lt;/p&gt;
&lt;p&gt;The following example retrieves characters from &lt;code&gt;&amp;quot;Hello&amp;quot;&lt;/code&gt; and creates new text.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;str = &amp;#34;Hello&amp;#34;
str2 = &amp;#34;&amp;#34;
for n in str:
    str2 = str2 + (n * 2) + &amp;#39;~&amp;#39;
print(str2)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;When you run the code, it displays &lt;code&gt;&amp;quot;HH~ee~ll~ll~oo~&amp;quot;&lt;/code&gt;. Remember that you can use list-like operations when working with characters in text.&lt;/p&gt;

      </description>
      
      <category>Python</category>
      
    </item>
    
    <item>
      <title>Python Introduction | Lists, Tuples, Ranges, Sets, and Dictionaries | Are Tuples Immutable Lists?</title>
      <link>https://www.devkuma.com/en/docs/python/%ED%8A%9C%ED%94%8C%EC%9D%80-%EB%B3%80%EA%B2%BD-%EB%B6%88%EA%B0%80%EB%8A%A5%ED%95%9C-%EB%A6%AC%EC%8A%A4%ED%8A%B8/</link>
      <pubDate>Wed, 20 Sep 2017 00:31:23 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/python/%ED%8A%9C%ED%94%8C%EC%9D%80-%EB%B3%80%EA%B2%BD-%EB%B6%88%EA%B0%80%EB%8A%A5%ED%95%9C-%EB%A6%AC%EC%8A%A4%ED%8A%B8/</guid>
      <description>
        
        
        &lt;p&gt;Python also provides tuples, which resemble lists. Write a tuple as follows.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;variable = (value1, value2, ...)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To retrieve a value, specify an index inside square brackets, as with a list. For example, write &lt;code&gt;str[0]&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;What is the difference between a list and a tuple? Tuple values cannot be changed. A tuple behaves like a constant rather than a variable.&lt;/p&gt;
&lt;p&gt;The ability to change values freely is important in programming. However, guaranteeing that values cannot change is also important. A list is unsuitable when unexpected updates would cause problems.&lt;/p&gt;
&lt;p&gt;A tuple guarantees that its values will not change. Such containers may initially seem unnecessary, but they are useful when values must remain stable.&lt;/p&gt;
&lt;p&gt;Other immutable containers include &lt;code&gt;range&lt;/code&gt;. Objects that cannot be modified are called immutable objects. Objects that can be changed are called mutable objects. A list is a representative mutable container.&lt;/p&gt;
&lt;p&gt;To use tuple values as a list later, convert them with a function.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Converting a Tuple to a List&lt;/strong&gt;&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;variable = list(tuple)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Converting a List to a Tuple&lt;/strong&gt;&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;variable = tuple(list)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following example uses a tuple and a list.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;tp&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;0&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt;&lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;1&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt;&lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;2&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt;&lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;3&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt;&lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;4&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;ls&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#204a87&#34;&gt;list&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;tp&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;for&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;n&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;in&lt;/span&gt; &lt;span style=&#34;color:#204a87&#34;&gt;range&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;0&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt;&lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;5&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#000&#34;&gt;ls&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;[&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;n&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;]&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;ls&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;[&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;n&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;]&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;for&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;n&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;in&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;tp&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#204a87&#34;&gt;print&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;ls&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;[&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;n&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The code creates the tuple &lt;code&gt;tp&lt;/code&gt;, converts it into the list &lt;code&gt;ls&lt;/code&gt;, and modifies the list values. Compare how &lt;code&gt;ls&lt;/code&gt; and &lt;code&gt;tp&lt;/code&gt; are used.&lt;/p&gt;

      </description>
      
      <category>Python</category>
      
    </item>
    
    <item>
      <title>Introduction to Python | Functions</title>
      <link>https://www.devkuma.com/en/docs/python/function/</link>
      <pubDate>Wed, 20 Sep 2017 00:31:23 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/python/function/</guid>
      <description>
        
        
        &lt;p&gt;Functions let you extract parts of a script for reuse at any time. Using functions effectively makes it possible to structure larger programs. This section explains the basics.&lt;/p&gt;

      </description>
      
      <category>Python</category>
      
    </item>
    
    <item>
      <title>Python Introduction | Functions | What Is a Function?</title>
      <link>https://www.devkuma.com/en/docs/python/%ED%95%A8%EC%88%98%EB%9E%80/</link>
      <pubDate>Wed, 20 Sep 2017 00:31:23 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/python/%ED%95%A8%EC%88%98%EB%9E%80/</guid>
      <description>
        
        
        &lt;p&gt;Scripts often repeat the same process many times. Writing the same code again each time is tedious. A function lets you call a predefined process whenever and wherever you need it.&lt;/p&gt;
&lt;p&gt;Consider Example 1. It stores names in variables and prints messages in the form &lt;code&gt;&amp;quot;Hello, OO. How are you?&amp;quot;&lt;/code&gt;. It repeats similar &lt;code&gt;print&lt;/code&gt; statements to display similar text.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example 1&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;a&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;Taro&amp;#34;&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;b&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;Hanako&amp;#34;&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;c&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;Ichiro&amp;#34;&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;   
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87&#34;&gt;print&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;Hello, &amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;a&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;. How are you?&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87&#34;&gt;print&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;Hello, &amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;b&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;. How are you?&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87&#34;&gt;print&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;Hello, &amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;c&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;. How are you?&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A function is useful in this situation. Example 2 rewrites the code using a function. First, define a function that prints a message in a fixed format. You can then call it at any time with code such as &lt;code&gt;showMsg(&amp;quot;Taro&amp;quot;)&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example 2&lt;/strong&gt;&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def showMsg(str): 
    print(&amp;#34;Hello, &amp;#34; + str + &amp;#34;. How are you?&amp;#34;) 
   
showMsg(&amp;#34;Taro&amp;#34;) 
showMsg(&amp;#34;Hanako&amp;#34;) 
showMsg(&amp;#34;Ichiro&amp;#34;) 
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This example only displays a short message. With more complicated processes, the ability to write code once and call it whenever needed becomes especially convenient.&lt;/p&gt;
&lt;h2 id=&#34;is-print-also-a-function&#34;&gt;Is print Also a Function?&lt;/h2&gt;
&lt;p&gt;You have already used a function: &lt;code&gt;print&lt;/code&gt;, which displays values. Python provides many built-in features, and most of them are available as functions.&lt;/p&gt;

      </description>
      
      <category>Python</category>
      
    </item>
    
    <item>
      <title>Python Introduction | Functions | Return Values</title>
      <link>https://www.devkuma.com/en/docs/python/%EB%B0%98%ED%99%98-%EA%B0%92/</link>
      <pubDate>Wed, 20 Sep 2017 00:31:23 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/python/%EB%B0%98%ED%99%98-%EA%B0%92/</guid>
      <description>
        
        
        &lt;p&gt;You can define a function if you know its name and arguments. However, another important element does not appear in the function name or arguments: the return value.&lt;/p&gt;
&lt;p&gt;A return value sends a value back to the caller after the function runs. Use &lt;code&gt;return&lt;/code&gt; to specify the value.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Function Definition 2&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;function_name&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;argument1&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;argument2&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;...&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;......&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;process&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;to&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;perform&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;......&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;value&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After performing its process, the function returns a value with &lt;code&gt;return value&lt;/code&gt;, and the caller receives it.&lt;/p&gt;
&lt;p&gt;Let us use a return value. The earlier example can be rewritten as follows.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;showMsg&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#204a87&#34;&gt;str&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;):&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;Hello,&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#204a87&#34;&gt;str&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;.How are you?&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;   
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;res&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;showMsg&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;Taro&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87&#34;&gt;print&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;res&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;res&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;showMsg&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;Hanako&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87&#34;&gt;print&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;res&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;showMsg&lt;/code&gt; function uses &lt;code&gt;return&lt;/code&gt; to send back text. Consider the following call.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;res&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;showMsg&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;Taro&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The result of &lt;code&gt;showMsg&lt;/code&gt; is assigned to the variable &lt;code&gt;res&lt;/code&gt;. The code then displays the result by using &lt;code&gt;res&lt;/code&gt;.&lt;/p&gt;

      </description>
      
      <category>Python</category>
      
    </item>
    
    <item>
      <title>Python Introduction | Functions | Keyword Arguments</title>
      <link>https://www.devkuma.com/en/docs/python/%ED%82%A4%EC%9B%8C%EB%93%9C-%EC%9D%B8%EC%88%98/</link>
      <pubDate>Wed, 20 Sep 2017 00:31:23 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/python/%ED%82%A4%EC%9B%8C%EB%93%9C-%EC%9D%B8%EC%88%98/</guid>
      <description>
        
        
        &lt;p&gt;Arguments are a surprisingly versatile part of a function. Besides passing values in the usual way, they provide several options.&lt;/p&gt;
&lt;p&gt;One option is a keyword argument. This feature lets you use a keyword, or name, when passing an argument.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Function Definition 3&lt;/strong&gt;&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def function(key1=initial_value1, key2=initial_value2, ...):
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Specify a key and an initial value. You can then pass arguments by using their keys. Ordinary arguments have a fixed order, but keyword arguments let you provide values regardless of their order.&lt;/p&gt;
&lt;p&gt;Because an initial value is available, you can also omit the argument. The function uses the default value when an argument is omitted. An ordinary argument must receive a value, but a keyword argument can work like an optional argument.&lt;/p&gt;
&lt;p&gt;Consider the following example.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;showMsg&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;name&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;header&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;Hello&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;footer&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;How are you?&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;):&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#204a87&#34;&gt;print&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;header&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;,&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;name&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;. &amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;footer&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;   
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;showMsg&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;Taro&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;showMsg&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;철수&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;안녕&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;건강하니?&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;showMsg&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;영희&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;footer&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;잘지내니?&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;header&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;야&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The code calls &lt;code&gt;showMsg&lt;/code&gt; in three ways. A call such as &lt;code&gt;showMsg(&amp;quot;Taro&amp;quot;)&lt;/code&gt; works with only the first argument because the second and third arguments use their initial values.&lt;/p&gt;
&lt;p&gt;Keyword names are optional. If you omit the names, specify arguments in the order in which they were defined. If you include keyword names, you can provide the arguments in any order.&lt;/p&gt;
&lt;p&gt;This example mixes arguments without default values and arguments with default values. In this situation, define arguments without default values first and keyword arguments afterward. Defining an argument without a default value after a keyword argument causes a syntax error.&lt;/p&gt;

      </description>
      
      <category>Python</category>
      
    </item>
    
    <item>
      <title>Python Introduction | Functions | Variable-Length Arguments</title>
      <link>https://www.devkuma.com/en/docs/python/%EA%B0%80%EB%B3%80-%EC%9D%B8%EC%9E%90/</link>
      <pubDate>Wed, 20 Sep 2017 00:31:23 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/python/%EA%B0%80%EB%B3%80-%EC%9D%B8%EC%9E%90/</guid>
      <description>
        
        
        &lt;p&gt;Another useful argument feature is the variable-length argument. A variable-length argument accepts a variable number of values. In other words, you can pass any number of arguments.&lt;/p&gt;
&lt;p&gt;This may seem unusual. How can a function receive an unknown number of arguments? A variable-length argument collects many values in a container. You can think of it as an argument that receives a list-like collection. Instead of creating that collection manually, you pass the values one by one, and Python groups them together automatically.&lt;/p&gt;
&lt;p&gt;Define a variable-length argument as follows.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Function Definition 4&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;function&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;*&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;argument&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Add an asterisk (&lt;code&gt;*&lt;/code&gt;) before the variable name in the argument definition. Python collects the provided values and passes them through that variable. You can then retrieve and process the values as needed.&lt;/p&gt;
&lt;p&gt;Consider the following example.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;calc&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;*&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;num&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;):&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#000&#34;&gt;total&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;for&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;n&lt;/span&gt; &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;in&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;num&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#000&#34;&gt;total&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;+=&lt;/span&gt; &lt;span style=&#34;color:#204a87&#34;&gt;int&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;n&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#204a87&#34;&gt;print&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;합계 : &amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#204a87&#34;&gt;str&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;total&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;))&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#204a87&#34;&gt;print&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#39;평균 : &amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#204a87&#34;&gt;str&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;total&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;//&lt;/span&gt; &lt;span style=&#34;color:#204a87&#34;&gt;len&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;num&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)))&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;   
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;calc&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;123&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;456&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;789&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;246&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;357&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#0000cf;font-weight:bold&#34;&gt;910&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The function is defined as &lt;code&gt;calc(*num)&lt;/code&gt;. All provided arguments are collected in &lt;code&gt;num&lt;/code&gt;. You can then iterate over &lt;code&gt;num&lt;/code&gt; with a &lt;code&gt;for&lt;/code&gt; statement.&lt;/p&gt;

      </description>
      
      <category>Python</category>
      
    </item>
    
    <item>
      <title>Introduction to Python | Using Classes</title>
      <link>https://www.devkuma.com/en/docs/python/%ED%81%B4%EB%9E%98%EC%8A%A4-%EC%82%AC%EC%9A%A9/</link>
      <pubDate>Wed, 20 Sep 2017 00:31:23 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/python/%ED%81%B4%EB%9E%98%EC%8A%A4-%EC%82%AC%EC%9A%A9/</guid>
      <description>
        
        
        &lt;p&gt;A class defines a larger program component that includes functions and various variables as a single unit. This section explains the basic usage of classes.&lt;/p&gt;

      </description>
      
      <category>Python</category>
      
    </item>
    
    <item>
      <title>Python Introduction | Using Classes | Functions and Classes</title>
      <link>https://www.devkuma.com/en/docs/python/%ED%95%A8%EC%88%98%EC%99%80-%ED%81%B4%EB%9E%98%EC%8A%A4/</link>
      <pubDate>Wed, 20 Sep 2017 00:31:23 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/python/%ED%95%A8%EC%88%98%EC%99%80-%ED%81%B4%EB%9E%98%EC%8A%A4/</guid>
      <description>
        
        
        &lt;p&gt;A function groups a process into one unit. As the number of functions increases, however, it becomes difficult to understand the role of each function. Understanding hundreds of unrelated functions would be challenging.&lt;/p&gt;
&lt;p&gt;A natural solution is to group things with similar roles.&lt;/p&gt;
&lt;p&gt;For example, consider data processing. A long list of separate functions for managing, adding, deleting, and displaying data is not easy to use.&lt;/p&gt;
&lt;p&gt;Instead, group everything needed to process the data. Create a large data-related unit containing variables for storing data and functions for reading, writing, adding, deleting, and displaying data.&lt;/p&gt;
&lt;p&gt;Then you know that anything related to the data is available inside that group. You do not need to search for functions scattered throughout the code.&lt;/p&gt;
&lt;p&gt;This is the idea behind a class. A class groups the values and processes required for a purpose.&lt;/p&gt;
&lt;p&gt;Define a class as shown below. Start with &lt;code&gt;class ClassName:&lt;/code&gt; and indent the variables and functions provided by the class.&lt;/p&gt;
&lt;h2 id=&#34;defining-a-class&#34;&gt;Defining a Class&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class ClassName:
  variable1
  variable2
  ...... provide as many variables as needed ......

  def method1(arguments):
      ...... method process ......
   
  def method2(arguments):
      ...... method process ......
   
  ...... provide as many methods as needed ......
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Variables that store values required by a class are called member variables. Functions provided by a class are called methods.&lt;/p&gt;
&lt;p&gt;The syntax is fundamentally the same as the syntax for ordinary variables and functions. Writing them inside a &lt;code&gt;class&lt;/code&gt; definition makes them member variables and methods.&lt;/p&gt;

      </description>
      
      <category>Python</category>
      
    </item>
    
    <item>
      <title>Python Introduction | Using Classes | Creating Classes</title>
      <link>https://www.devkuma.com/en/docs/python/%ED%81%B4%EB%9E%98%EC%8A%A4-%EC%83%9D%EC%84%B1/</link>
      <pubDate>Wed, 20 Sep 2017 00:31:23 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/python/%ED%81%B4%EB%9E%98%EC%8A%A4-%EC%83%9D%EC%84%B1/</guid>
      <description>
        
        
        &lt;p&gt;Let us create and use a class. The following example moves the earlier process of displaying a message with a name into a &lt;code&gt;Member&lt;/code&gt; class.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Member: 
    name = &amp;#34;&amp;#34; 
   
    def showMsg(self): 
        print(&amp;#34;Hello, &amp;#34; + self.name + &amp;#34;. How are you?&amp;#34;)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The member variable &lt;code&gt;name&lt;/code&gt; stores a name. The &lt;code&gt;showMsg&lt;/code&gt; method displays a message.&lt;/p&gt;
&lt;p&gt;The source code introduces &lt;code&gt;self&lt;/code&gt;, which appears as an argument of &lt;code&gt;showMsg&lt;/code&gt;. It is not an ordinary argument.&lt;/p&gt;
&lt;p&gt;Inside the method, the expression &lt;code&gt;self.name&lt;/code&gt; refers to a member variable.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;self&lt;/code&gt; is a special value that represents the current instance. It does not represent the class itself.&lt;/p&gt;
&lt;h2 id=&#34;instances-and-self&#34;&gt;Instances and self&lt;/h2&gt;
&lt;p&gt;A class is like a blueprint. You do not usually operate on the blueprint directly. Instead, create an instance from the class and operate on that instance.&lt;/p&gt;
&lt;p&gt;If you used a class directly, you could not independently store data for both &lt;code&gt;&amp;quot;Taro&amp;quot;&lt;/code&gt; and &lt;code&gt;&amp;quot;Hanako&amp;quot;&lt;/code&gt; in the same &lt;code&gt;name&lt;/code&gt; variable. Instead, create separate &lt;code&gt;Member&lt;/code&gt; instances and assign a name to each one.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;self&lt;/code&gt; refers to the current instance. When a method needs a member variable stored in that instance, use a qualified name such as &lt;code&gt;self.name&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Python methods receive the instance as their first argument. Access its member variables and methods by writing a dot after &lt;code&gt;self&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;self.variable
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;For example, use &lt;code&gt;self.name&lt;/code&gt; to access the &lt;code&gt;name&lt;/code&gt; member variable.&lt;/p&gt;

      </description>
      
      <category>Python</category>
      
    </item>
    
    <item>
      <title>Python Introduction | Using Classes | Using a Class</title>
      <link>https://www.devkuma.com/en/docs/python/%ED%81%B4%EB%9E%98%EC%8A%A4-%EC%82%AC%EC%9A%A9/</link>
      <pubDate>Wed, 20 Sep 2017 00:31:23 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/python/%ED%81%B4%EB%9E%98%EC%8A%A4-%EC%82%AC%EC%9A%A9/</guid>
      <description>
        
        
        &lt;p&gt;Now let us use the &lt;code&gt;Member&lt;/code&gt; class we created. The following source code is an example.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Member: 
    name = &amp;#34;&amp;#34; 
   
    def showMsg(self): 
        print(&amp;#34;Hello,&amp;#34; + self.name + &amp;#34;.How are you?&amp;#34;) 
   
taro = Member() 
taro.name = &amp;#34;Taro&amp;#34;
taro.showMsg() 
   
hanako = Member() 
hanako.name = &amp;#34;Hanako&amp;#34;
hanako.showMsg()
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This example creates and uses two instances to handle data for two people, Taro and Hanako.&lt;/p&gt;
&lt;p&gt;Create an instance by calling the class name followed by parentheses, as in &lt;code&gt;ClassName()&lt;/code&gt;. This example calls:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;taro = Member()
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This creates an instance of the &lt;code&gt;Member&lt;/code&gt; class and stores it in the variable &lt;code&gt;taro&lt;/code&gt;. Access an instance&amp;rsquo;s member variables and methods by writing their names after the variable name with a dot (&lt;code&gt;.&lt;/code&gt;). For example:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;taro.name = &amp;#34;Taro&amp;#34;
taro.showMsg()
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;These statements assign &lt;code&gt;&amp;quot;Taro&amp;quot;&lt;/code&gt; to the &lt;code&gt;name&lt;/code&gt; member variable of the &lt;code&gt;taro&lt;/code&gt; instance and then call its &lt;code&gt;showMsg&lt;/code&gt; method. Once an instance has been created and assigned to a variable, you can freely use the elements defined by its class.&lt;/p&gt;
&lt;p&gt;A member variable such as &lt;code&gt;name&lt;/code&gt;, which stores a separate value for each instance, is also called an instance variable.&lt;/p&gt;
&lt;h2 id=&#34;where-did-self-go&#34;&gt;Where Did self Go?&lt;/h2&gt;
&lt;p&gt;This example may raise a question about the call to &lt;code&gt;showMsg&lt;/code&gt;: it is written as &lt;code&gt;taro.showMsg()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Doesn&amp;rsquo;t &lt;code&gt;showMsg&lt;/code&gt; define &lt;code&gt;self&lt;/code&gt; as its first argument? What happened to that argument?&lt;/p&gt;
&lt;p&gt;When a method is called, Python automatically passes the instance itself as the first argument. Therefore, you do not specify the first argument, &lt;code&gt;self&lt;/code&gt;, when calling the method. Write only the arguments after the first one. In this example, there are no additional arguments, so the call uses empty parentheses.&lt;/p&gt;
&lt;p&gt;Creating an instance, setting its member variables, and calling its methods are the basics of using a class. Once you understand these operations, classes are straightforward to use.&lt;/p&gt;

      </description>
      
      <category>Python</category>
      
    </item>
    
    <item>
      <title>Python Introduction | Using Classes | Using Constructors</title>
      <link>https://www.devkuma.com/en/docs/python/%EC%83%9D%EC%84%B1%EC%9E%90-%EC%82%AC%EC%9A%A9/</link>
      <pubDate>Wed, 20 Sep 2017 00:31:23 +0900</pubDate>
      <author>kc@example.com (kc kim)</author>
      <guid>https://www.devkuma.com/en/docs/python/%EC%83%9D%EC%84%B1%EC%9E%90-%EC%82%AC%EC%9A%A9/</guid>
      <description>
        
        
        &lt;p&gt;The &lt;code&gt;Member&lt;/code&gt; class is still not especially useful. Creating an instance, setting &lt;code&gt;name&lt;/code&gt;, and calling &lt;code&gt;showMsg&lt;/code&gt; one step at a time is not very different from working without a class. In addition, if you forget to set a member variable after creating an instance, the program will not behave as expected. At minimum, required values should be set correctly from the beginning.&lt;/p&gt;
&lt;p&gt;A constructor is useful in this situation. A constructor is a special method for initializing an instance that is called automatically when the instance is created. Define one as follows.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;__init__&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#3465a4&#34;&gt;self&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;arguments&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;...&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;...&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;initialization&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;...&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Define a constructor as a method named &lt;code&gt;__init__&lt;/code&gt;. To pass values to it, specify them from the second argument onward. The first argument must always be &lt;code&gt;self&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Once a constructor is defined, it is used when an instance is created. Consider the following example.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;class&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;Member&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;:&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#000&#34;&gt;name&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;   
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;__init__&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#3465a4&#34;&gt;self&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;,&lt;/span&gt; &lt;span style=&#34;color:#204a87&#34;&gt;str&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;):&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#3465a4&#34;&gt;self&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;name&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#204a87&#34;&gt;str&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;   
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#204a87;font-weight:bold&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;showMsg&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#3465a4&#34;&gt;self&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;):&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#204a87&#34;&gt;print&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;Hello,&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#3465a4&#34;&gt;self&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;name&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;.How are you?&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;   
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;taro&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;Member&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;Taro&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;taro&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;showMsg&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;()&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;   
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;hanako&lt;/span&gt; &lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#000&#34;&gt;Member&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;(&lt;/span&gt;&lt;span style=&#34;color:#4e9a06&#34;&gt;&amp;#34;Hanako&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;)&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#000&#34;&gt;hanako&lt;/span&gt;&lt;span style=&#34;color:#ce5c00;font-weight:bold&#34;&gt;.&lt;/span&gt;&lt;span style=&#34;color:#000&#34;&gt;showMsg&lt;/span&gt;&lt;span style=&#34;color:#000;font-weight:bold&#34;&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This example defines a constructor that receives an argument named &lt;code&gt;str&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;def __init__(self, str):
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The &lt;code&gt;name&lt;/code&gt; value must now be supplied when an instance is created. Look at the statement that creates an instance.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;taro = Member(&amp;#34;Taro&amp;#34;)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The name is passed as an argument inside the parentheses. Allowing arguments to be specified when creating an instance is convenient because required member variables can be initialized at the same time.&lt;/p&gt;

      </description>
      
      <category>Python</category>
      
    </item>
    
  </channel>
</rss>
