<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://ideawaza.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=63.3.21.0%2F24</id>
	<title>IdeaWazaWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://ideawaza.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=63.3.21.0%2F24"/>
	<link rel="alternate" type="text/html" href="https://ideawaza.com/wiki/Special:Contributions/63.3.21.0/24"/>
	<updated>2026-09-29T19:17:52Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://ideawaza.com/index.php?title=Python/Basic_functions&amp;diff=36953</id>
		<title>Python/Basic functions</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Python/Basic_functions&amp;diff=36953"/>
		<updated>2007-08-01T13:02:30Z</updated>

		<summary type="html">&lt;p&gt;63.3.21.130: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A function is a way of tying a bunch of code together so that it can be used at a later time.  To create a function, it must be defined with the def command.&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt;def example():&lt;br /&gt;
       print &#039;I am a seemingly self aware function!&#039;&lt;br /&gt;
&lt;br /&gt;
This assigns the name &#039;example&#039; in the same way that the statement &#039;x = 1&#039; assigns the name x to the value 1.  &lt;br /&gt;
Merely typing the name of the function will show you such.&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt;example&lt;br /&gt;
    &amp;lt;function example at 0x01680730&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To actually call the function, you have to include parenthesis afterwards.&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; example()&lt;br /&gt;
    I am a seemingly self aware function!&lt;br /&gt;
&lt;br /&gt;
The reason for the parenthesis is so that you can pass arguments to functions that require them.  &lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; def square(x):&lt;br /&gt;
        print str(x**2)&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; square(4)&lt;br /&gt;
    16&lt;br /&gt;
&lt;br /&gt;
If we wanted to use the value that the square function gives us, we would rewrite it make use of the return command.&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; def square(x):&lt;br /&gt;
        return (x**2)&lt;br /&gt;
&lt;br /&gt;
Which can then be used to do such fun things as:&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; print square(3)&lt;br /&gt;
    9&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt;print square(square(3))&lt;br /&gt;
    81&lt;br /&gt;
&lt;br /&gt;
or even in statements such as:&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt;10 + square(2)&lt;br /&gt;
    14&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; y = square(10)&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; y&lt;br /&gt;
    100&lt;/div&gt;</summary>
		<author><name>63.3.21.130</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Python/Basic_functions&amp;diff=36952</id>
		<title>Python/Basic functions</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Python/Basic_functions&amp;diff=36952"/>
		<updated>2007-08-01T13:01:50Z</updated>

		<summary type="html">&lt;p&gt;63.3.21.130: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A function is a way of tying a bunch of code together so that it can be used at a later time.  To create a function, it must be defined with the def command.&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt;def example():&lt;br /&gt;
       print &#039;I am a seemingly self aware function!&#039;&lt;br /&gt;
&lt;br /&gt;
This assigns the name &#039;example&#039; in the same way that the statement &#039;x = 1&#039; assigns the name x to the value 1.  &lt;br /&gt;
Merely typing the name of the function will show you such.&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt;example&lt;br /&gt;
    &amp;lt;function example at 0x01680730&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To actually call the function, you have to include parenthesis afterwards.&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; example()&lt;br /&gt;
    I am a seemingly self aware function!&lt;br /&gt;
&lt;br /&gt;
The reason for the parenthesis is so that you can pass arguments to functions that require them.  &lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; def square(x):&lt;br /&gt;
        print str(x**2)&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; square(4)&lt;br /&gt;
    16&lt;br /&gt;
&lt;br /&gt;
If we wanted to use the value that the square function gives us, we would rewrite it make use of the return command.&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; def square(x):&lt;br /&gt;
        return (x**2)&lt;br /&gt;
&lt;br /&gt;
Which can then be used to do such fun things as:&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; print square(3)&lt;br /&gt;
    9&lt;br /&gt;
&lt;br /&gt;
    or&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt;print square(square(3))&lt;br /&gt;
    81&lt;br /&gt;
&lt;br /&gt;
    or even in statements such as:&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt;10 + square(2)&lt;br /&gt;
    14&lt;br /&gt;
&lt;br /&gt;
    and&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; y = square(10)&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; y&lt;br /&gt;
    100&lt;/div&gt;</summary>
		<author><name>63.3.21.130</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Python/Basic_functions&amp;diff=36951</id>
		<title>Python/Basic functions</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Python/Basic_functions&amp;diff=36951"/>
		<updated>2007-08-01T13:00:34Z</updated>

		<summary type="html">&lt;p&gt;63.3.21.130: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A function is a way of tying a bunch of code together so that it can be used at a later time.  To create a function, it must be defined with the def command.&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt;def example():&lt;br /&gt;
       print &#039;I am a seemingly self aware function!&#039;&lt;br /&gt;
&lt;br /&gt;
This assigns the name &#039;example&#039; in the same way that the statement &#039;x = 1&#039; assigns the name x to the value 1.  &lt;br /&gt;
Merely typing the name of the function will show you such.&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt;example&lt;br /&gt;
    &amp;lt;function example at 0x01680730&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To actually call the function, you have to include parenthesis afterwards.&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; example()&lt;br /&gt;
    I am a seemingly self aware function!&lt;br /&gt;
&lt;br /&gt;
The reason for the parenthesis is so that you can pass arguments to functions that require them.  &lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; def square(x):&lt;br /&gt;
        print str(x**2)&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; square(4)&lt;br /&gt;
    16&lt;br /&gt;
&lt;br /&gt;
If we wanted to use the value that the square function gives us, we would rewrite it make use of the return command.&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; def square(x):&lt;br /&gt;
	return (x**2)&lt;br /&gt;
&lt;br /&gt;
Which can then be used to do such fun things as:&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; print square(3)&lt;br /&gt;
    9&lt;br /&gt;
&lt;br /&gt;
    or&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt;print square(square(3))&lt;br /&gt;
    81&lt;br /&gt;
&lt;br /&gt;
    or even in statements such as:&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt;10 + square(2)&lt;br /&gt;
    14&lt;br /&gt;
&lt;br /&gt;
    and&lt;br /&gt;
&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; y = square(10)&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; y&lt;br /&gt;
    100&lt;/div&gt;</summary>
		<author><name>63.3.21.130</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Python/Basic_functions&amp;diff=36950</id>
		<title>Python/Basic functions</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Python/Basic_functions&amp;diff=36950"/>
		<updated>2007-08-01T12:56:11Z</updated>

		<summary type="html">&lt;p&gt;63.3.21.130: New page: A function is a way of tying a bunch of code together so that it can be used at a later time.  To create a function, it must be defined with the def command.  &amp;gt;&amp;gt;&amp;gt;def example():        prin...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A function is a way of tying a bunch of code together so that it can be used at a later time.  To create a function, it must be defined with the def command.&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt;def example():&lt;br /&gt;
       print &#039;I am a seemingly self aware function!&#039;&lt;br /&gt;
&lt;br /&gt;
This assigns the name &#039;example&#039; in the same way that the statement &#039;x = 1&#039; assigns the name x to the value 1.  &lt;br /&gt;
Merely typing the name of the function will show you such.&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt;example&lt;br /&gt;
&amp;lt;function example at 0x01680730&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To actually call the function, you have to include parenthesis afterwards.&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; example()&lt;br /&gt;
I am a seemingly self aware function!&lt;br /&gt;
&lt;br /&gt;
The reason for the parenthesis is so that you can pass arguments to functions that require them.  &lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; def square(x):&lt;br /&gt;
	print str(x**2)&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; square(4)&lt;br /&gt;
16&lt;br /&gt;
&lt;br /&gt;
If we wanted to use the value that the square function gives us, we would rewrite it make use of the return command.&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; def square(x):&lt;br /&gt;
	return (x**2)&lt;br /&gt;
&lt;br /&gt;
Which can then be used to do such fun things as:&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; print square(3)&lt;br /&gt;
9&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt;print square(square(3))&lt;br /&gt;
81&lt;br /&gt;
&lt;br /&gt;
or even in statements such as:&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt;10 + square(2)&lt;br /&gt;
14&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; y = square(10)&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; y&lt;br /&gt;
100&lt;/div&gt;</summary>
		<author><name>63.3.21.130</name></author>
	</entry>
</feed>