<?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>if else in python Archives -</title>
	<atom:link href="https://mitindia.in/tag/if-else-in-python/feed/" rel="self" type="application/rss+xml" />
	<link>https://mitindia.in/tag/if-else-in-python/</link>
	<description></description>
	<lastBuildDate>Fri, 17 Apr 2020 10:56:12 +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>if else in python Archives -</title>
	<link>https://mitindia.in/tag/if-else-in-python/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Python Programs for Beginners – Part2</title>
		<link>https://mitindia.in/python-programs-for-beginners-part2/</link>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Thu, 17 Oct 2019 11:05:44 +0000</pubDate>
				<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[elif in python]]></category>
		<category><![CDATA[if else in python]]></category>
		<category><![CDATA[looping programs in python]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=992</guid>

					<description><![CDATA[<p>Basic Python Programs for Beginners – Part 2 # program to display employee salary information name=input(&#8220;Enter Name:&#8221;) dept=input(&#8220;Enter Department:&#8221;) basic=int(input(&#8220;Enter Basic salary:&#8221;)) bonus=basic*(5/100) pf=basic*(10/100) net=basic+bonus-pf print(&#8220;Employee Details&#8221;) print(&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8220;) print(&#8220;Name=&#8221;, name) print(&#8220;Basic=&#8221;, basic) print(&#8220;Bonus=&#8221;, bonus) print(&#8220;Provident Fund=&#8221;, pf) print(&#8220;Net salary=&#8221;, net) OUTPUT: Enter Name:Ganesh Enter Department:Finance Enter Basic salary:25000 Employee Details &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; Name= Ganesh Basic= 25000 [&#8230;]</p>
<p>The post <a href="https://mitindia.in/python-programs-for-beginners-part2/">Python Programs for Beginners – Part2</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1>Basic Python Programs for Beginners – Part 2</h1>
<p><span style="color: #ff0000;"><strong># program to display employee salary information</strong></span><br />
name=input(&#8220;Enter Name:&#8221;)<br />
dept=input(&#8220;Enter Department:&#8221;)<br />
basic=int(input(&#8220;Enter Basic salary:&#8221;))<br />
bonus=basic*(5/100)<br />
pf=basic*(10/100)<br />
net=basic+bonus-pf<br />
print(&#8220;Employee Details&#8221;)<br />
print(&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&#8220;)<br />
print(&#8220;Name=&#8221;, name)<br />
print(&#8220;Basic=&#8221;, basic)<br />
print(&#8220;Bonus=&#8221;, bonus)<br />
print(&#8220;Provident Fund=&#8221;, pf)<br />
print(&#8220;Net salary=&#8221;, net)</p>
<p><strong>OUTPUT:</strong></p>
<blockquote><p>Enter Name:Ganesh<br />
Enter Department:Finance<br />
Enter Basic salary:25000<br />
Employee Details<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Name= Ganesh<br />
Basic= 25000<br />
Bonus= 1250.0<br />
Provident Fund= 2500.0<br />
Net salary= 23750.0</p></blockquote>
<p><strong><span style="color: #ff0000;"># Program to display Marks information</span></strong><br />
name=input(&#8220;Enter Student Name:&#8221;)<br />
p=int(input(&#8220;Enter Physics Marks:&#8221;))<br />
c=int(input(&#8220;Enter Chemistry Marks:&#8221;))<br />
m=int(input(&#8220;Enter Math Marks:&#8221;))<br />
b=int(input(&#8220;Enter Biology Marks:&#8221;))<br />
tot=p+c+m+b<br />
avg=float(tot)/4;</p>
<p>print(&#8220;\tStudent Name=&#8221;,name)<br />
print(&#8220;\tPhysic Marks=&#8221;,p)<br />
print(&#8220;\tChemistry Marks=&#8221;,c)<br />
print(&#8220;\tMath Marks=&#8221;,m)<br />
print(&#8220;\tBiology Marks=&#8221;,b)<br />
print(&#8220;\t=============&#8221;)<br />
print(&#8220;\tTotal Marks=&#8221;,tot)<br />
print(&#8220;\tAverage Marks=&#8221;,avg)</p>
<p>if ((avg&gt;80) and (avg&lt;=100)):<br />
print(&#8220;\tResult is Distinction&#8221;)<br />
elif((avg&gt;60) and (avg&lt;80)):<br />
print(&#8220;\tFirst Class&#8221;)<br />
elif((avg&gt;50) and (avg&lt;60)):<br />
print(&#8220;\tSecond Class&#8221;)<br />
elif((avg&gt;35) and (avg&lt;50)):<br />
print(&#8220;\tSecond Class&#8221;)<br />
else:<br />
print(&#8220;\tFail .. Try again&#8221;)</p>
<p><strong>OUTPUT</strong></p>
<blockquote>
<div>Enter Student Name:Sharan</div>
<div>Enter Physics Marks:59</div>
<div>Enter Chemistry Marks:95</div>
<div>Enter Math Marks:86</div>
<div>Enter Biology Marks:65</div>
<div>Student Name= Sharan</div>
<div>Physic Marks= 59</div>
<div>Chemistry Marks= 95</div>
<div>Math Marks= 86</div>
<div>Biology Marks= 65</div>
<div>=============</div>
<div>Total Marks= 305</div>
<div>Average Marks= 76.25</div>
<div>First Class</div>
</blockquote>
<p><strong><span style="color: #ff0000;"># Looping Program using Python : prints 0-10 numbers</span></strong><br />
for x in range(11):<br />
print(x)</p>
<p><strong>OUTPUT:</strong></p>
<blockquote><p>0<br />
1<br />
2<br />
3<br />
4<br />
5<br />
6<br />
7<br />
8<br />
9<br />
10</p></blockquote>
<p><span style="color: #ff0000;"><strong># Looping Program using Python: prints 5-10 numbers</strong></span><br />
for y in range(5,11):<br />
print(y)</p>
<p><strong>OUTPUT: </strong></p>
<blockquote><p>5<br />
6<br />
7<br />
8<br />
9<br />
10</p></blockquote>
<p><strong><span style="color: #ff0000;"># Looping Program using Python : prints 1-10 numbers with 2 increments</span> </strong><br />
for z in range(1,11,2):<br />
print(z)</p>
<p><strong>OUTPUT:</strong></p>
<blockquote><p>1<br />
3<br />
5<br />
7<br />
9</p></blockquote>
<p><span style="color: #ff0000;"><strong># program to print table of entered number</strong></span><br />
num=int(input(&#8220;Enter Number:&#8221;))<br />
for x in range(1,11):<br />
print(num*x)<br />
else:<br />
print(&#8220;Printed Finally!!!&#8221;)</p>
<p><strong>OUTPUT:</strong></p>
<blockquote><p>Enter Number:5<br />
5<br />
10<br />
15<br />
20<br />
25<br />
30<br />
35<br />
40<br />
45<br />
50<br />
Printed Finally!!!</p></blockquote>
<p><strong><span style="color: #ff0000;"># Program to use Nested loop in python</span></strong><br />
for x in range(1,11):<br />
for y in range(1,11):<br />
print(x*y, end=&#8221;\t&#8221;)<br />
print()</p>
<p><strong>OUTPUT:</strong></p>
<p><img decoding="async" class="alignnone size-medium wp-image-997" src="http://www.mitindia.in/wp-content/uploads/2019/10/nest-300x113.jpg" alt="" width="300" height="113" srcset="https://mitindia.in/wp-content/uploads/2019/10/nest-300x113.jpg 300w, https://mitindia.in/wp-content/uploads/2019/10/nest-768x290.jpg 768w, https://mitindia.in/wp-content/uploads/2019/10/nest.jpg 974w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p><a href="https://www.mitindia.in/python-programs-for-beginners-part1/" target="_blank" rel="noopener">Click here for Python Programs for Beginners – Part1</a></p>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fpython-programs-for-beginners-part2%2F&amp;linkname=Python%20Programs%20for%20Beginners%20%E2%80%93%20Part2" 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%2Fpython-programs-for-beginners-part2%2F&amp;linkname=Python%20Programs%20for%20Beginners%20%E2%80%93%20Part2" 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%2Fpython-programs-for-beginners-part2%2F&#038;title=Python%20Programs%20for%20Beginners%20%E2%80%93%20Part2" data-a2a-url="https://mitindia.in/python-programs-for-beginners-part2/" data-a2a-title="Python Programs for Beginners – Part2"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/python-programs-for-beginners-part2/">Python Programs for Beginners – Part2</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Python Programs for Beginners &#8211; Part1</title>
		<link>https://mitindia.in/python-programs-for-beginners-part1/</link>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Wed, 16 Oct 2019 12:30:42 +0000</pubDate>
				<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[if else in python]]></category>
		<category><![CDATA[sum of two numbers in python]]></category>
		<category><![CDATA[what is python]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=982</guid>

					<description><![CDATA[<p>Basic Python Programs for Beginners &#8211; Part 1 Watch This Video session for How to Run your First Python Program # Sum of two numbers program on python a=int(input("Enter Num1:")) b=int(input("Enter Num2:")) c=a+b print "sum of {0} and {1} is {2}" .format(a,b,c) c=a-b print "subtraction of {0} from {1} is {2}".format(a,b,c) c=a*b print "muliplication of [&#8230;]</p>
<p>The post <a href="https://mitindia.in/python-programs-for-beginners-part1/">Python Programs for Beginners &#8211; Part1</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1>Basic Python Programs for Beginners &#8211; Part 1</h1>
<div><strong>Watch This Video session for How to Run your First Python Program</strong></div>
<div><iframe src="https://www.youtube.com/embed/vZTHx3YTU50" width="360" height="215" frameborder="0" allowfullscreen="allowfullscreen"></iframe></div>
<div><span style="color: #800000;"><strong># Sum of two numbers program on python</strong></span></div>
<div>
<pre class="EnlighterJSRAW" data-enlighter-language="null">a=int(input("Enter Num1:"))
b=int(input("Enter Num2:"))
c=a+b
print "sum of {0} and {1} is {2}" .format(a,b,c)

c=a-b
print "subtraction of {0} from {1} is {2}".format(a,b,c)

c=a*b
print "muliplication of {0} and {1} is {2}".format(a,b,c)

c=a/b
print "division of {0} by {1} is {2}".format(a,b,c)</pre>
<p>&nbsp;</p>
</div>
<div><strong>Output: </strong></div>
<div><img fetchpriority="high" decoding="async" class="alignnone size-medium wp-image-983" src="http://www.mitindia.in/wp-content/uploads/2019/10/sum2-300x175.jpg" alt="" width="300" height="175" srcset="https://mitindia.in/wp-content/uploads/2019/10/sum2-300x175.jpg 300w, https://mitindia.in/wp-content/uploads/2019/10/sum2.jpg 491w" sizes="(max-width: 300px) 100vw, 300px" /></div>
<div></div>
<div><span style="color: #800000;"><strong># Program to print simple and compound interest</strong></span></div>
<div>
<pre class="EnlighterJSRAW" data-enlighter-language="null">p=float(input("Enter Principle amount:"))
t=float(input("Time Duration:"))
r=float(input("Enter Rate of int:"))

si=(p*t*r)/100;
print "simple int = ", si
ci=p*(1+r/100)*r
print "compound int = ", ci</pre>
<p>&nbsp;</p>
</div>
<div><strong>Output: </strong></div>
<div><img decoding="async" class="alignnone size-medium wp-image-984" src="http://www.mitindia.in/wp-content/uploads/2019/10/si-300x149.jpg" alt="" width="300" height="149" srcset="https://mitindia.in/wp-content/uploads/2019/10/si-300x149.jpg 300w, https://mitindia.in/wp-content/uploads/2019/10/si.jpg 418w" sizes="(max-width: 300px) 100vw, 300px" /></div>
<div></div>
<div><span style="color: #800000;"><strong># Find area of circle</strong></span></div>
<div>
<pre class="EnlighterJSRAW" data-enlighter-language="null">r=float(input("Enter radius:"))
PI=3.142
area=PI*(r*r);
print "Area is= ", area</pre>
<p>&nbsp;</p>
</div>
<div><strong>Output: </strong></div>
<div><img loading="lazy" decoding="async" class="alignnone size-full wp-image-985" src="http://www.mitindia.in/wp-content/uploads/2019/10/aoc.jpg" alt="" width="299" height="137" /></div>
<div></div>
<div><span style="color: #800000;"><strong># if and else statements</strong></span></div>
<div>
<pre class="EnlighterJSRAW" data-enlighter-language="null">amount = int(input("Enter amount: "))

if amount&lt;5000:
   discount = amount*0.05
   print ("Discount",discount)
else:
   discount = amount*0.20
   print "Discount",discount

print "Net payable:",amount-discount
</pre>
<p>&nbsp;</p>
</div>
<div><strong>Output:</strong></div>
<div><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-986" src="http://www.mitindia.in/wp-content/uploads/2019/10/ifelse-300x127.jpg" alt="" width="300" height="127" srcset="https://mitindia.in/wp-content/uploads/2019/10/ifelse-300x127.jpg 300w, https://mitindia.in/wp-content/uploads/2019/10/ifelse.jpg 375w" sizes="(max-width: 300px) 100vw, 300px" /></div>
<div></div>
<div><span style="color: #800000;"><strong>#Program to check, entered number is Even or Odd</strong></span></div>
<div>
<pre class="EnlighterJSRAW" data-enlighter-language="null">x=int(input("Enter any number:"))
if (x%2==0):
print("Even");
else:
print("Odd");
</pre>
<p>&nbsp;</p>
</div>
<div><strong>Output:</strong></div>
<div><img loading="lazy" decoding="async" class="alignnone size-full wp-image-987" src="http://www.mitindia.in/wp-content/uploads/2019/10/evod.jpg" alt="" width="276" height="129" /></div>
<div></div>
<div><span style="color: #800000;"><strong># largest of three numbers using python</strong></span></div>
<div>
<pre class="EnlighterJSRAW" data-enlighter-language="null">a=int(input("Enter num1:"))
b=int(input("Enter num2:"))
c=int(input("Enter num3:"))

if ((a&gt;b) and (a&gt;c)):
 print("a is large")
elif ((b&gt;a) and (b&gt;c)):
 print("b is large")
else:
 print("c is large")
</pre>
<p>&nbsp;</p>
</div>
<div><strong>Output:</strong></div>
<div><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-988" src="http://www.mitindia.in/wp-content/uploads/2019/10/large-300x166.jpg" alt="" width="300" height="166" srcset="https://mitindia.in/wp-content/uploads/2019/10/large-300x166.jpg 300w, https://mitindia.in/wp-content/uploads/2019/10/large.jpg 325w" sizes="(max-width: 300px) 100vw, 300px" /></div>
<div></div>
<div><span style="color: #0000ff;"><a style="color: #0000ff;" href="https://www.mitindia.in/python-programs-for-beginners-part2/" target="_blank" rel="noopener">Python Programs for Beginners – Part2</a></span></div>
<div><span style="color: #0000ff;"><a style="color: #0000ff;" href="https://www.mitindia.in/how-to-run-python-programs-on-wamp-server/">How to run python on WAMP server </a></span></div>
<div></div>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fpython-programs-for-beginners-part1%2F&amp;linkname=Python%20Programs%20for%20Beginners%20%E2%80%93%20Part1" 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%2Fpython-programs-for-beginners-part1%2F&amp;linkname=Python%20Programs%20for%20Beginners%20%E2%80%93%20Part1" 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%2Fpython-programs-for-beginners-part1%2F&#038;title=Python%20Programs%20for%20Beginners%20%E2%80%93%20Part1" data-a2a-url="https://mitindia.in/python-programs-for-beginners-part1/" data-a2a-title="Python Programs for Beginners – Part1"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/python-programs-for-beginners-part1/">Python Programs for Beginners &#8211; Part1</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
