<?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>Comparison Operators on Antonio Montemurro</title><link>https://antoniomontemurro.com/en/tags/comparison-operators/</link><description>Recent content in Comparison Operators on Antonio Montemurro</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Sat, 26 Oct 2024 09:38:49 +0000</lastBuildDate><atom:link href="https://antoniomontemurro.com/en/tags/comparison-operators/index.xml" rel="self" type="application/rss+xml"/><item><title>Operators in Python: Arithmetic, Comparison, and Logical</title><link>https://antoniomontemurro.com/en/posts/operators-python-arithmetic-comparison-logical/</link><pubDate>Sat, 26 Oct 2024 09:38:49 +0000</pubDate><guid>https://antoniomontemurro.com/en/posts/operators-python-arithmetic-comparison-logical/</guid><description>&lt;p&gt;In Python, as in every programming language, there are various operators for manipulating numbers, logical values, and comparing objects.&lt;/p&gt;
&lt;h2 id="arithmetic-operators"&gt;Arithmetic Operators&lt;/h2&gt;
&lt;p&gt;The most familiar ones are the mathematical operators.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-wp-block-code" data-lang="wp-block-code"&gt;Sum: +
Subtraction: -
Multiplication: *
Division: / or //
Exponentiation: **
Modulus: %
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Let’s see an example for each operator:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code class="language-wp-block-code" data-lang="wp-block-code"&gt;print(10 + 3) # Addition: 13
print(10 - 3) # Subtraction: 7
print(10 * 3) # Multiplication: 30
print(10 / 3) # Division: 3.3333...
print(10 // 3) # Floor Division: 3
print(10 ** 3) # Exponentiation: 1000
print(10 % 3) # Modulus: 1
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Of these, the one worth a quick note is the &lt;code&gt;//&lt;/code&gt; operator, also known as “Floor Division.” This operator simply rounds down the division result to the nearest integer.&lt;/p&gt;</description></item></channel></rss>