<?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://paper.wf/paulsutton/tag:arguments</link>
    <description>Paul Sutton - personal blog </description>
    <pubDate>Thu, 07 May 2026 02:06:38 +0000</pubDate>
    <item>
      <title>Code Club - Python functions 2</title>
      <link>https://paper.wf/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]]&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>
]]></content:encoded>
      <guid>https://paper.wf/paulsutton/code-club-python-functions-2</guid>
      <pubDate>Mon, 29 May 2023 06:00:00 +0000</pubDate>
    </item>
  </channel>
</rss>