<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Elif on Antonio Montemurro</title><link>https://antoniomontemurro.com/en/tags/elif/</link><description>Recent content in Elif on Antonio Montemurro</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Fri, 27 Dec 2024 12:30:51 +0000</lastBuildDate><atom:link href="https://antoniomontemurro.com/en/tags/elif/index.xml" rel="self" type="application/rss+xml"/><item><title>Control Flow and Loops in Python</title><link>https://antoniomontemurro.com/en/posts/control-flow-loops-python/</link><pubDate>Fri, 27 Dec 2024 12:30:51 +0000</pubDate><guid>https://antoniomontemurro.com/en/posts/control-flow-loops-python/</guid><description>&lt;p&gt;In all modern programming languages, conditional statements and loops are essential for two primary purposes:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Making decisions based on given or computed values.&lt;/li&gt;
&lt;li&gt;Automating repetitive tasks to avoid rewriting the same code.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="ifelse"&gt;&lt;strong&gt;If…else&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;if...else&lt;/code&gt; statement allows you to change the normal flow of code execution by evaluating a specific condition.&lt;/p&gt;
&lt;p&gt;Here is an example&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-wp-block-code" data-lang="wp-block-code"&gt;x = int(input(&amp;#34;Insert a number:&amp;#34;))
if x % 2 == 0:
print(&amp;#34;Your number is even&amp;#34;)
else:
print(&amp;#34;Your number is odd&amp;#34;)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This code will print a different message depending on whether the value entered by the user is an even or an odd number.&lt;/p&gt;</description></item></channel></rss>