<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Aarya Maurya on Medium]]></title>
        <description><![CDATA[Stories by Aarya Maurya on Medium]]></description>
        <link>https://medium.com/@ariabotics?source=rss-b65f678499ea------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*JxmWRHRV4YrnRAvwRqB47A.png</url>
            <title>Stories by Aarya Maurya on Medium</title>
            <link>https://medium.com/@ariabotics?source=rss-b65f678499ea------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 22:29:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ariabotics/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Working with Numbers & Comments in Python]]></title>
            <link>https://medium.com/@ariabotics/working-with-numbers-comments-in-python-9ef65cf4c520?source=rss-b65f678499ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ef65cf4c520</guid>
            <dc:creator><![CDATA[Aarya Maurya]]></dc:creator>
            <pubDate>Thu, 24 Jul 2025 11:56:42 GMT</pubDate>
            <atom:updated>2025-07-25T17:01:51.124Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*se_5q6mWjtCOP57eFhMoXw.gif" /></figure><p>Python is a high‑level programming language designed for clarity and ease of use. It treats numbers as first‑class objects, which means you can write mathematical expressions directly in your code. When you press Enter in <a href="https://medium.com/@ariabotics/python-idle-interactive-mode-vs-script-mode-e69154306dea">Python’s interactive shell (REPL)</a>, it evaluates your expressions instantly just like a calculator, but far more powerful.</p><p>In Python, numbers help your program count, measure, and do calculations. There are three main kinds:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/0*zk8_hTsZdOlOGcmG" /></figure><p><strong>Integers (</strong><strong>int)<br></strong>Whole numbers without a decimal point.<br>Examples: 7, -2, 0</p><pre># Integer (int)<br>whole = 5<br>print(whole) # Output: 5<br>print(type(whole)) # Output: &lt;class &#39;int&#39;&gt;</pre><p><strong>Floating‑point (</strong><strong>float)<br></strong>Numbers with a decimal point.<br>Examples: 3.14, 0.01, -2.5</p><pre># Floating‑point (float)<br>decimal = 3.14<br>print(decimal)           # Output: 3.14<br>print(type(decimal))     # Output: &lt;class &#39;float&#39;&gt;</pre><p><strong>Complex (</strong><strong>complex)<br></strong>Numbers with a real part and an imaginary part.<br>The imaginary part uses j.<br>Example: 1 + 2j</p><pre># Complex (complex)<br>imag = 1 + 2j<br>print(imag)              # Output: (1+2j)<br>print(type(imag))        # Output: &lt;class &#39;complex&#39;&gt;</pre><p>Because Python stores very large or very small floats automatically, you do not have to worry about choosing “float32” or “float64” yourself.</p><pre>big_int   = 12345678901234567890<br>tiny_float = 0.000_000_1<br>z = 3 + 5j<br>print(type(big_int))    # &lt;class &#39;int&#39;&gt;<br>print(type(tiny_float)) # &lt;class &#39;float&#39;&gt;<br>print(type(z))          # &lt;class &#39;complex&#39;&gt;</pre><h3><strong>Arithmetic in Python</strong></h3><p>Python’s interactive shell (IDLE or running python in a terminal) lets you experiment with math instantly. You type an expression, press Enter, and see the result right away</p><p><strong>Math Symbols</strong></p><p><strong>Addition (</strong><strong>+)</strong><br>Adds two numbers.</p><pre>print(8 + 3)   # Output: 11</pre><p><strong>Subtraction (</strong><strong>-)</strong><br>Subtracts the right‑hand number from the left‑hand number.</p><pre>print(8 - 3)   # Output: 5</pre><p><strong>Multiplication (*)<br></strong> Multiplies two numbers.</p><pre><br>print(6 * 7)   # Output: 42</pre><p><strong>Division (</strong><strong>/)</strong><br>Divides the left‑hand number by the right‑hand number and always returns a floating‑point result.</p><pre>print(9 / 2)   # Output: 4.5</pre><h3>The help() Function</h3><p>When you wonder <em>“What can this object do?”</em>, type help() and pass the object:</p><pre>help(int)     <br># Learn about integers<br>help(print)   <br># Learn about the print function</pre><p>Python shows a small manual page right inside the shell.<br> If you type help() with no argument, an interactive help session starts. Type a topic name, press Enter, and read the documentation. Type quit to exit.</p><pre>&gt;&gt;&gt; help()<br>help&gt; str<br># A full description of strings appears<br>help&gt; quit</pre><h3>Comments in Python</h3><p>Python ignores them completely, so they never change how the program runs. <br>Use comments to explain <em>why</em> you wrote code a certain way or to turn code off temporarily.<br>To add comments in our program, we type a ‘#’ (Pound) sign in front of each line of comment like this:</p><h3>Single-Line Comment</h3><p>Start the line with #:</p><pre># This line explains the next command<br>print(&quot;Hello&quot;)</pre><p>Everything after # until the end of that line is skipped.</p><h3>Multi-Line Comment</h3><p>Python has no dedicated multi-line comment symbol. Two common tricks exist:</p><p>Use many single-line comments:</p><pre># This is line 1 of my explanation<br># This is line 2<br># This is line 3</pre><p>Alternatively we can also use three single quotes `&#39;&#39;&#39;` or three double quotes `”””`for multi-line comments, like this:</p><pre># Example of a triple‑quoted multiline comment using double quotes<br>&quot;&quot;&quot;<br>This block looks like a string,<br>but since it is not saved in a variable,<br>Python ignores it at run time.<br>&quot;&quot;&quot;</pre><pre># Example of a triple‑quoted multiline comment using single quotes<br>&#39;&#39;&#39;<br>This block is also treated like a string,<br>but because we never assign it to a variable,<br>Python skips it when running the code.<br>&#39;&#39;&#39;</pre><h3>Type Conversion (Typecasting)</h3><p><strong>Type conversion</strong> means changing a value from one type to another. For example, changing a number to a string, or a float to an integer. Python has easy ways to do this using built-in functions.</p><h4>1. Explicit Conversion (Manual)</h4><p>This means <em>you</em> decide to convert the value using a function like int(), float(), or str().</p><p>Examples:</p><pre>int(4.7)       # Gives 4 → decimal part is removed, not rounded<br>float(&quot;3&quot;)     # Gives 3.0 → string to float<br>str(2 + 3)     # Gives &#39;5&#39; → number to string</pre><blockquote>Note: When converting from float to int, Python does <strong>not round</strong> the number. It just removes the decimal part (cuts off).</blockquote><h4>2. Implicit Conversion (Automatic)</h4><p>This happens <strong>automatically</strong> when Python needs to do it. You don’t write any code to convert — Python does it for you.</p><p>Example:</p><pre>result = 5 + 2.5  # int + float = float → 7.5</pre><p>Here, Python changed 5 (int) to 5.0 (float) because it was mixed with a float. This keeps decimal accuracy.</p><h4>Conclusion</h4><p>Know the three number types: int, float, and complex. Use the right type for your data. Python makes math easy with simple symbols and helpful tools like the help() function. Use <strong>comments</strong> to explain your code. Learn both <strong>manual</strong> and <strong>automatic</strong> type conversion to avoid bugs and work better with numbers and strings.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ef65cf4c520" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python IDLE: Interactive Mode vs Script Mode]]></title>
            <link>https://medium.com/@ariabotics/python-idle-interactive-mode-vs-script-mode-e69154306dea?source=rss-b65f678499ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/e69154306dea</guid>
            <category><![CDATA[robotics]]></category>
            <category><![CDATA[interactive-mode]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[script-mode]]></category>
            <category><![CDATA[idle]]></category>
            <dc:creator><![CDATA[Aarya Maurya]]></dc:creator>
            <pubDate>Mon, 21 Jul 2025 19:04:29 GMT</pubDate>
            <atom:updated>2025-07-25T17:01:16.230Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*byxAAR9g7bw1RzPepLpHfQ.gif" /></figure><p>When starting your Python journey especially in fields like robotics it’s essential to understand how Python code is written and run.</p><p>Python provides two main ways to interact with your code:</p><p><strong>Interactive Mode and Script Mode</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a1oR94hCj6zyqAAcyRgVBQ.png" /><figcaption><strong>Interactive Mode</strong> vs <strong>Script Mode</strong></figcaption></figure><p>Each serves a unique purpose.</p><ul><li>Want to quickly test a math formula? Use Interactive Mode.</li><li>Want to build a full program to control a robot? That’s what Script Mode is for.</li></ul><p>Both modes are available in Python’s IDLE, a beginner-friendly development environment. Whether you’re just learning or already solving real-world problems in robotics, knowing when and how to use these two modes will make your coding experience smoother, faster, and more effective.</p><h3>Interactive Mode</h3><p><strong>Interactive Mode</strong> is Python’s immediate execution environment where you can type commands one at a time and see results instantly.</p><p>Example:</p><pre>(base) PS D:\VS Code\Aarya Maurya\Workspace&gt;<br>&gt;&gt;&gt; 5 + 5<br>10<br>&gt;&gt;&gt; 2 - 6<br>-4<br>&gt;&gt;&gt; 3 * 6<br>18<br>&gt;&gt;&gt; 3 * 8 + 6 / 2<br>27.0<br>&gt;&gt;&gt; miles = 26.2 <br>&gt;&gt;&gt; miles * 1.61 <br>42.182</pre><ul><li>The &gt;&gt;&gt; prompt signals the interactive environment (REPL).</li><li>Each operation’s result appears right after pressing Enter.</li><li>The current directory in the prompt indicates you can compute from any project folder.</li></ul><p>When you open IDLE (Integrated Development and Learning Environment), you’re greeted with the Python shell displaying the &gt;&gt;&gt; prompt, which signals you&#39;re in interactive mode.</p><ul><li><strong>Immediate feedback: </strong>Each mathematical expression (addition, subtraction, multiplication, combination of operations) is evaluated instantly, and the result is displayed below the command.</li><li><strong>Session Navigation: </strong>The prompt displays the current working directory, showing these calculations can be done from any project folder.</li><li><strong>Ease of Use:</strong> The interactive session (often initiated through a Python REPL or with commands like Shift+Enter for interactive environments) allows for rapid testing and learning.</li><li><strong>No Need to Save: </strong>These calculations are not stored unless manually recorded elsewhere, but highly useful nature of interactive mode for quick experiments.</li></ul><p>In Interactive Mode, expressions automatically display their values.</p><p>For example, typing 2 + 3 immediately shows 5, and miles = 26.2; miles * 1.61 displays 42.182.</p><h3>Script Mode</h3><p>Script Mode involves writing complete Python programs in .py files that you can save, edit, and run as reusable units. This mode is ideal for building entire programs, especially when working on robotics projects that involve multiple steps, mathematical functions, or data input.</p><p>When you open IDLE’s Editor (through File → New File or Ctrl+N), you’re switching from the shell (&gt;&gt;&gt;) to the script writing area. Once code is written, it must be saved as a .py file, and then run using F5 or Run → Run Module.</p><p>Example: Sample Script (<em>greeting.py</em>):</p><pre># greeting.py<br>print(&quot;Hello, Python!&quot;)</pre><p>When you run this script using F5, you’ll see the following output in the shell (python debugger):</p><pre>Hello, Python!</pre><ul><li><strong>Saving Your Code:</strong> Code is stored in .py files so that it can be reused or modified later — very useful for robotics projects that evolve over time.</li><li><strong>Longer / complex programs:</strong> Unlike interactive mode (line-by-line), you can write multiple functions, conditional blocks, loops, and class definitions in a script.</li><li><strong>Requires </strong><strong>print() for output:</strong> Unlike the interactive mode where results are automatically shown, in script mode you must use the print() function to display results.</li><li><strong>Code editing tools: </strong>IDLE editor provides features such as syntax highlighting, indentation, auto-completion, and integration with the debugger to help you write error-free code.</li><li><strong>Professional workflow:</strong> Script mode prepares you for practical programming — useful in robotics where scripts control hardware, analyze data, or simulate movement.</li></ul><h3>IDLE: Your Gateway to Both Modes</h3><p><strong>IDLE (Integrated Development and Learning Environment)</strong> serves as Python’s built-in IDE, providing access to both modes within a user-friendly interface.</p><p>IDLE comes pre-installed with Python and offers essential features for beginners:</p><h3>IDLE Features for Learning:</h3><ul><li><strong>Syntax highlighting</strong>: Different code elements are color-coded for clarity</li><li><strong>Auto-completion</strong>: Suggests code completions as you type</li><li><strong>Built-in debugger</strong>: Helps identify and fix errors in your code</li><li><strong>Call tips</strong>: Provides information about function parameters</li><li><strong>Cross-platform compatibility</strong>: Works consistently across Windows, macOS, and Linux</li></ul><h3>Creating Your First Script in IDLE:</h3><ol><li><strong>Open IDLE</strong>: Launch IDLE from your applications menu</li><li><strong>Create new file</strong>: Go to <strong>File → New File</strong> or press <strong>Ctrl+N</strong></li><li><strong>Write your code</strong>: Enter your Python program in the editor window <br>eg: <em>print(“Hello, I’m Testing”)</em></li><li><strong>Save the file</strong>: Use <strong>File → Save As</strong> and give it a .py extension<br>eg: <em>greeting.py</em></li><li><strong>Run the script</strong>: Press <strong>F5</strong> or go to <strong>Run → Run Module</strong></li></ol><h3>Transitioning Between Modes:</h3><p>The most effective learning approach combines both modes:</p><ol><li><strong>Start with Interactive Mode</strong>: Test concepts and small code snippets</li><li><strong>Move to Script Mode</strong>: Develop complete, reusable programs</li><li><strong>Iterate</strong>: Use Interactive Mode to debug and test parts of your scripts</li><li><strong>Build complexity</strong>: Gradually create more sophisticated robotics applications</li></ol><h3>Conclusion</h3><p>Python’s Interactive and Script Modes will help you build a strong foundation in programming especially for robotics, where you combine quick experiments and full programs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*MHJQtEUJlE2KnuA9kQEEKQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e69154306dea" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>