<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>built-in functions in python Archives -</title>
	<atom:link href="https://mitindia.in/tag/built-in-functions-in-python/feed/" rel="self" type="application/rss+xml" />
	<link>https://mitindia.in/tag/built-in-functions-in-python/</link>
	<description></description>
	<lastBuildDate>Fri, 18 Oct 2019 11:17:59 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://mitindia.in/wp-content/uploads/2023/03/cropped-android-chrome-512x512-1-32x32.png</url>
	<title>built-in functions in python Archives -</title>
	<link>https://mitindia.in/tag/built-in-functions-in-python/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Built-in and user defined functions in Python</title>
		<link>https://mitindia.in/built-in-and-user-defined-functions-in-python/</link>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Fri, 18 Oct 2019 11:17:59 +0000</pubDate>
				<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[built-in functions in python]]></category>
		<category><![CDATA[functions in python]]></category>
		<category><![CDATA[user defined functions in python]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=999</guid>

					<description><![CDATA[<p># Built-in functions in Python [importing math package] import math x=int(input(&#8220;Enter any number:&#8221;)) print(&#8220;Square root of {0} is {1}&#8221;.format(x,math.sqrt(x))) print(&#8220;Square of {0} is {1}&#8221;.format(x, x*x)) print(&#8220;Cube of {0} is {1}&#8221;.format(x, x*x*x)) OutPut: Enter any number:5 Square root of 5 is 2.23606797749979 Square of 5 is 25 Cube of 5 is 125 &#160; User-defined functions  def [&#8230;]</p>
<p>The post <a href="https://mitindia.in/built-in-and-user-defined-functions-in-python/">Built-in and user defined functions in Python</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><span style="color: #3366ff;"><strong># Built-in functions in Python [importing math package]</strong></span><br />
import math<br />
x=int(input(&#8220;Enter any number:&#8221;))<br />
print(&#8220;Square root of {0} is {1}&#8221;.format(x,math.sqrt(x)))<br />
print(&#8220;Square of {0} is {1}&#8221;.format(x, x*x))<br />
print(&#8220;Cube of {0} is {1}&#8221;.format(x, x*x*x))</p>
<p><strong>OutPut:</strong></p>
<blockquote><p>Enter any number:5<br />
Square root of 5 is 2.23606797749979<br />
Square of 5 is 25<br />
Cube of 5 is 125</p></blockquote>
<p>&nbsp;</p>
<p style="text-align: center;"><span style="color: #ff0000;"><strong>User-defined functions </strong></span></p>
<p>def my_function():<br />
print(&#8220;Hello from a function&#8221;)</p>
<p>def disp():<br />
print(&#8220;this is disp function&#8221;)</p>
<p>my_function()<br />
disp()</p>
<p><strong>OUTPUT:</strong></p>
<blockquote><p>Hello from a function<br />
this is disp function</p></blockquote>
<p><span style="color: #3366ff;"><strong># using Functions in Python</strong></span><br />
def fun_disp():<br />
print(&#8220;Inside the user defined function&#8221;)</p>
<p>fun_disp()</p>
<p><strong>OUTPUT:</strong></p>
<blockquote><p>Inside the user-defined function</p>
<p>&nbsp;</p></blockquote>
<p><span style="color: #3366ff;"><strong># Functions in Python</strong></span><br />
def per_det():<br />
name=input(&#8220;Enter Name:&#8221;)<br />
age=int(input(&#8220;Enter age:&#8221;))<br />
print(&#8220;Name=&#8221;,name)<br />
print(&#8220;Age=&#8221;,age)</p>
<p>def aca_det():<br />
edu=input(&#8220;Enter educational qualification:&#8221;)<br />
exp=input(&#8220;Experience, if any:&#8221;)<br />
print(&#8220;Educational Qualification=&#8221;, edu)<br />
print(&#8220;Experience=&#8221;, exp)</p>
<p>per_det()<br />
aca_det()</p>
<p><strong>OUTPUT:</strong></p>
<blockquote><p>Enter Name:Ganesh<br />
Enter age:21<br />
Name= Ganesh<br />
Age= 21<br />
Enter educational qualification:PhD<br />
Experience, if any:1<br />
Educational Qualification= PhD<br />
Experience= 1</p>
<p><strong><span style="color: #3366ff;"># Program to check number is even or odd using functions in python</span></strong><br />
def eve_odd(x):<br />
if (x%2==0):<br />
print(&#8220;Number is even!&#8221;)<br />
else:<br />
print(&#8220;Number is odd!&#8221;)<br />
eve_odd(2)</p></blockquote>
<p><strong>OUTPUT:</strong></p>
<blockquote><p>Number is even!</p></blockquote>
<p><span style="color: #3366ff;"><strong># Program using functions in python</strong></span><br />
def swap():<br />
a=int(input(&#8220;Enter Num1:&#8221;))<br />
b=int(input(&#8220;Enter Num2:&#8221;))<br />
c=a ;<br />
a=b;<br />
b=c;<br />
print(a)<br />
print(b)</p>
<p># Call the function here<br />
swap()</p>
<p><strong>OUTPUT:</strong></p>
<blockquote><p>Enter Num1:4<br />
Enter Num2:5<br />
5<br />
4</p></blockquote>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fbuilt-in-and-user-defined-functions-in-python%2F&amp;linkname=Built-in%20and%20user%20defined%20functions%20in%20Python" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Fbuilt-in-and-user-defined-functions-in-python%2F&amp;linkname=Built-in%20and%20user%20defined%20functions%20in%20Python" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Fbuilt-in-and-user-defined-functions-in-python%2F&#038;title=Built-in%20and%20user%20defined%20functions%20in%20Python" data-a2a-url="https://mitindia.in/built-in-and-user-defined-functions-in-python/" data-a2a-title="Built-in and user defined functions in Python"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/built-in-and-user-defined-functions-in-python/">Built-in and user defined functions in Python</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
