<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>arguments &amp;mdash; Paul Sutton</title>
    <link>https://personaljournal.ca/paulsutton/tag:arguments</link>
    <description>Personal Blog</description>
    <pubDate>Thu, 14 May 2026 02:40:53 +0000</pubDate>
    <item>
      <title>Code Club - Python functions 2</title>
      <link>https://personaljournal.ca/paulsutton/code-club-python-functions-2</link>
      <description>&lt;![CDATA[Code Club - Python functions 2&#xA;&#xA;So to follow the previous post,  we are going to look at passing 2 arguments to a function, adding them together, then displaying the result. &#xA;&#xA;Firstly open a new Python Trinket&#xA;&#xA;Firstly we are going to tell the interpreter to use python3. &#xA;#!/usr/bin/env python3 #use python 3&#xA;Now we create a function to take two arguments and display the sub of both&#xA;def addnumbers(x,z):&#xA;  #print(x)&#xA;  #print(z)&#xA;  add = (int(x) + int(z))&#xA;  print (&#39;Total = &#39;)&#xA;  print(add)&#xA;Get user input  &#xA;x = input(&#34;First Number&#34;) # ask for first number&#xA;z = input(&#34;Second Number&#34;) # ask for second number&#xA;Convert to integers&#xA;int(x)&#xA;int(z)&#xA;Call function and pass values to function&#xA;addnumbers(x,z)&#xA;&#xA;Tags&#xA;&#xA;#CodeClub,#Python.#Programming,#Functions,#Arguments&#xA;&#xA;hr&#xD;&#xA;&#xD;&#xA;table&#xD;&#xA;thead&#xD;&#xA;trtda rel=&#34;me&#34; href=&#34;https://qoto.org/@zleap&#34;Mastodon/a/td&#xD;&#xA;tda href=&#34;https://wiki.ircnow.org/?n=Shelllabs.Intro&#34;ShellLabs/td&#xD;&#xA;tda href=&#34;https://joinmastodon.org/&#34;Join Mastodon/a/td/tr/thead/table&#xD;&#xA;center&#xD;&#xA;AI statement : b Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. /b&#xD;&#xA;/center&#xD;&#xA;&#xD;&#xA;a href=&#34;https://liberapay.com/PaulSutton/donate&#34;img alt=&#34;Donate using Liberapay&#34; src=&#34;https://liberapay.com/assets/widgets/donate.svg&#34;/a&#xD;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>Code Club – Python functions 2</p>

<p>So to follow the previous post,  we are going to look at passing 2 arguments to a function, adding them together, then displaying the result.</p>

<p>Firstly open a <a href="https://trinket.io/library/trinkets/create?lang=python" rel="nofollow">new Python Trinket</a></p>

<p>Firstly we are going to tell the interpreter to use python3.</p>

<pre><code>#!/usr/bin/env python3 #use python 3
</code></pre>

<p>Now we create a function to take two arguments and display the sub of both</p>

<pre><code>def add_numbers(x,z):
  #print(x)
  #print(z)
  add = (int(x) + int(z))
  print (&#39;Total = &#39;)
  print(add)
</code></pre>

<p>Get user input</p>

<pre><code>x = input(&#34;First Number&#34;) # ask for first number
z = input(&#34;Second Number&#34;) # ask for second number
</code></pre>

<p>Convert to integers</p>

<pre><code>int(x)
int(z)
</code></pre>

<p>Call function and pass values to function</p>

<pre><code>add_numbers(x,z)
</code></pre>

<p><strong>Tags</strong></p>

<p><a href="/paulsutton/tag:CodeClub" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">CodeClub</span></a>,<a href="/paulsutton/tag:Python" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Python</span></a>.<a href="/paulsutton/tag:Programming" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Programming</span></a>,<a href="/paulsutton/tag:Functions" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Functions</span></a>,<a href="/paulsutton/tag:Arguments" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Arguments</span></a></p>

<hr>

<p><table>
<thead>
<tr><td><a href="https://qoto.org/@zleap" rel="nofollow">Mastodon</a></td>
<td><a href="https://wiki.ircnow.org/?n=Shelllabs.Intro" rel="nofollow">ShellLabs</td>
<td><a href="https://joinmastodon.org/" rel="nofollow">Join Mastodon</a></td></tr></thead></table>

AI statement : <b> Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. </b>
</p>

<p><a href="https://liberapay.com/PaulSutton/donate" rel="nofollow"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></p>
]]></content:encoded>
      <guid>https://personaljournal.ca/paulsutton/code-club-python-functions-2</guid>
      <pubDate>Mon, 29 May 2023 06:00:00 +0000</pubDate>
    </item>
  </channel>
</rss>