<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Irfan Faisal</title>
    <description>The latest articles on Forem by Irfan Faisal (@coderanger08).</description>
    <link>https://forem.com/coderanger08</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F803658%2F18219a63-0d77-42a3-b557-18b41b89a1eb.jpg</url>
      <title>Forem: Irfan Faisal</title>
      <link>https://forem.com/coderanger08</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/coderanger08"/>
    <language>en</language>
    <item>
      <title>Connecting Gemini CLI to Docker MCP — Build Your Own AI Tool Ecosystem</title>
      <dc:creator>Irfan Faisal</dc:creator>
      <pubDate>Sat, 04 Oct 2025 18:22:51 +0000</pubDate>
      <link>https://forem.com/coderanger08/connecting-gemini-cli-to-docker-mcp-build-your-own-ai-tool-ecosystem-7ef</link>
      <guid>https://forem.com/coderanger08/connecting-gemini-cli-to-docker-mcp-build-your-own-ai-tool-ecosystem-7ef</guid>
      <description>&lt;p&gt;Hello everyone! Today we will learn about how to run Gemini CLI as MCP client with Docker MCP Server. &lt;strong&gt;Gemini CLI&lt;/strong&gt; is a command-line version of Google’s Gemini that lets developers build AI agents, automate workflows, and run headless or backend tasks. Unlike Claude desktop or chatgpt , it’s fast, scriptable, and open, giving developers full control to combine AI reasoning with real-world actions.&lt;/p&gt;

&lt;p&gt;The game-changing feature is that you can use MCP Server in Gemini CLI by turning it into MCP Client. Before diving into it more, lets clear some basics.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What are MCP Server and MCP Client?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;MCP stands for Model Context Protocol. It’s a new open standard that lets AI models (like Gemini, Claude, or ChatGPT) communicate with external tools or apps in a consistent, secure way.&lt;/p&gt;

&lt;p&gt;With the help of MCP server, you can give your AI agent or model access to multiple tools and make your agentic work smarter.&lt;/p&gt;

&lt;p&gt;And the AI models or AI agents that will use the MCP server to use tools are called MCP clients.&lt;/p&gt;

&lt;p&gt;Now let's dive into our today's main focus.  I will show you step-by-step how you can use Docker MCP in your Gemini CLI.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 1: Install Docker&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Go to this link and download the installer file for Docker.&lt;a href="https://www.docker.com/get-started/" rel="noopener noreferrer"&gt;Docker Desktop&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click your installer file and start the installation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Make sure to enable this button otherwise docker won't run successfully.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl319yef43qkgffox9g7m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl319yef43qkgffox9g7m.png" alt="Docker installation" width="800" height="337"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click next and complete the installation process.&lt;/li&gt;
&lt;li&gt;After that, click your Docker Desktop and start your Docker engine.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 2: Install Node.js.&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To run &lt;strong&gt;the Gemini CLI&lt;/strong&gt;, Node.js is a requirement. Go to this link and download Node.js. &lt;a href="https://nodejs.org/en/download" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 3: Install Gemini CLI Globally&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;For Windows, Mac, or Linux, run this code in your command prompt and install Gemini CLI.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install -g @google/gemini-cli&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After installing, verify the Gemini version&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gemini --version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then, you must log in with your Google account.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gemini login&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After completing the installation, just write "gemini" in your command prompt, and the Gemini CLI interface will start running. You can use this as you use Gemini by generating texts and doing web searches (you will need the Gemini API for that), but the best part is that now this CLI has access to all the files of your local machine! How cool is that!&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 4: Docker MCP&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Docker Desktop already has a built-in MCP toolkit, which allows you to select any MCP server you want out of 223 servers from their catalogs. You can also choose Claude desktop, Gemini CLI, or Cursor as your MCP client. In this tutorial, we will focus on using Gemini CLI as an MCP client for MCP Docker.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First, go to MCP toolkit in Docker Desktop.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7425rvdpn2leh89ak7hj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7425rvdpn2leh89ak7hj.png" alt="MCP toolkit" width="373" height="992"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next, go to the catalog to search for our desired MCP server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fww2p5ab4t6tptnczik4v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fww2p5ab4t6tptnczik4v.png" alt=" " width="800" height="133"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In this tutorial we will show how to add the Wikipedia MCP server to your Docker. For that reason, search for Wikipedia and select the Wikipedia server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1yomy2ap5l57vck2u36o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1yomy2ap5l57vck2u36o.png" alt="Wikipedia" width="800" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next, you can see the Wikipedia server in the "My Servers" tab.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Congrats! Now you have added the Wikipedia MCP server to your Docker Desktop! That's how easy the whole process is. Next, we will add Gemini CLI as an MCP client.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 5: Gemini CLI as MCP client&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;This step is also very easy. First, go to the "Clients" tab in the MCP toolkit and connect Gemini CLI. That's it; your Gemini CLI is now connected to Docker MCP.&lt;/li&gt;
&lt;li&gt;Next, go to your command prompt and write Gemini. This will initiate Gemini in your command line. It will look something like this:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ybld8pf3846f3sbkot2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ybld8pf3846f3sbkot2.png" alt="gemini cli" width="800" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can see that your Gemini CLI is already connected to Docker MCP. You can check that by writing &lt;code&gt;/mcp&lt;/code&gt; in the command line.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7yqp3gzw6l90oldha6i4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7yqp3gzw6l90oldha6i4.png" alt=" " width="718" height="358"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Debugging:&lt;/strong&gt; In case your Docker MCP is not showing in Gemini CLI,&lt;br&gt;
just run &lt;code&gt;docker mcp gateway run&lt;/code&gt; and this will connect your Docker MCP to Gemini CLI.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 6: We're ready!&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Now let's test our MCP server. Our Docker MCP now has access to Wikipedia. And with the Gemini CLI as an MCP client, we can directly access all the tools of Wikipedia. Let's test it!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First, go to your command prompt and write "gemini." This will initialize the Gemini CLI.&lt;/li&gt;
&lt;li&gt;Then write this: "search in wikipedia for Milkyway Galaxy"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5j7urfwrn6tctrhdux0g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5j7urfwrn6tctrhdux0g.png" alt="search" width="800" height="369"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Then you will see something like this. Click "Allow once" and go to the next step.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsnaookyzeqs2anw6gqq3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsnaookyzeqs2anw6gqq3.png" alt="Allow once" width="798" height="327"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Gemini will use the "search_wikipedia" tool with the query of "Milkyway galaxy" and will show a result like this.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0sepqa5zh2uqxa4dg2on.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0sepqa5zh2uqxa4dg2on.png" alt="result" width="800" height="278"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your Gemini may ask if you want a summary like this in the photo. If you say yes, it will show a summary of the article.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Femevntwppkpmpbxtkv0n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Femevntwppkpmpbxtkv0n.png" alt="summary" width="800" height="377"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Congrats! You have done it!&lt;/strong&gt;&lt;br&gt;
Great news! You have successfully tested your Docker MCP server in Gemini CLI. Now you have countless possibilities. From using the Gmail MCP server to send mail to using MongoDB for your database, you can do whatever you want. The sky is the limit!&lt;/p&gt;

&lt;p&gt;In the next tutorial, we will show how to automate and send mail to multiple email addresses with just one command with the help of Gemini CLI and MCP Docker. &lt;/p&gt;

</description>
      <category>mcp</category>
      <category>gemini</category>
      <category>docker</category>
      <category>ai</category>
    </item>
    <item>
      <title>Building a Universal CSV to Supabase Importer: From Messy Data to Structured Database</title>
      <dc:creator>Irfan Faisal</dc:creator>
      <pubDate>Tue, 16 Sep 2025 04:21:52 +0000</pubDate>
      <link>https://forem.com/coderanger08/building-a-universal-csv-to-supabase-importer-from-messy-data-to-structured-database-2na2</link>
      <guid>https://forem.com/coderanger08/building-a-universal-csv-to-supabase-importer-from-messy-data-to-structured-database-2na2</guid>
      <description>&lt;p&gt;&lt;em&gt;How I built a Python script that automatically transforms CSV files into clean, queryable database records&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem: Data Ingestion Nightmare
&lt;/h2&gt;

&lt;p&gt;Picture this: You've got CSV files scattered across your system - product inventories, customer lists, sales data, you name it. Each file has different column names, missing values, and inconsistent formatting. You need to get this data into a database so your applications can actually use it.&lt;/p&gt;

&lt;p&gt;The traditional approach? Manual copy-pasting, Excel gymnastics, or writing custom scripts for each file. Sound familiar? I've been there, and it's a productivity killer.&lt;/p&gt;

&lt;p&gt;That's exactly why I built a &lt;strong&gt;Universal CSV to Supabase Importer&lt;/strong&gt; - a Python script that automatically handles the messy details of data transformation and database insertion.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution: Automated Data Pipeline
&lt;/h2&gt;

&lt;p&gt;My solution is a flexible Python script that acts as a data pipeline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CSV File → Data Cleaning → Column Mapping → Validation → Supabase Database
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The beauty of this approach is its simplicity and reusability. Once configured, you can process any CSV file with just one command.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Tech Stack: Why These Choices?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Python + Pandas
&lt;/h3&gt;

&lt;p&gt;Python is the obvious choice for data manipulation, and pandas makes CSV processing trivial. It handles various encodings, missing values, and data types automatically.&lt;/p&gt;

&lt;h3&gt;
  
  
  Supabase
&lt;/h3&gt;

&lt;p&gt;I chose Supabase over traditional databases and Firebase for several key reasons. Supabase offers zero configuration setup with auto-generated REST endpoints, eliminating the need for custom API code. The platform provides real-time capabilities with built-in subscriptions and an excellent Python client library for seamless database operations. Unlike Firebase's NoSQL approach, Supabase uses PostgreSQL, which offers more robust SQL capabilities and better data integrity - perfect for handling structured CSV data with complex queries and relationships.&lt;/p&gt;

&lt;h3&gt;
  
  
  Environment Variables (.env)
&lt;/h3&gt;

&lt;p&gt;Security first! All sensitive credentials are stored in environment variables, never hardcoded in the source code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deep Dive: How the Magic Happens
&lt;/h2&gt;

&lt;p&gt;Let me walk you through the core logic of the importer:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Secure Configuration Setup
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;dotenv&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;load_dotenv&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;

&lt;span class="nf"&gt;load_dotenv&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;# Load environment variables from .env file
&lt;/span&gt;
&lt;span class="n"&gt;SUPABASE_URL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SUPABASE_URL&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;SUPABASE_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SUPABASE_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Ensure credentials are loaded
&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;SUPABASE_URL&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;SUPABASE_KEY&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;ValueError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Supabase credentials not found. Make sure .env file is correctly configured.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This approach ensures your API keys never end up in version control, which is crucial for security.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Intelligent Data Cleaning
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Convert all relevant columns to string type and replace 'nan' and empty strings with None
&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;col&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;columns&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;col&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;supabase_schema_columns&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;astype&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;nan&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This step is crucial because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Consistency&lt;/strong&gt;: All data becomes strings, preventing type mismatches&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Null Handling&lt;/strong&gt;: Empty values become proper &lt;code&gt;NULL&lt;/code&gt; in the database&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error Prevention&lt;/strong&gt;: Avoids JSON serialization issues with &lt;code&gt;NaN&lt;/code&gt; values&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Flexible Column Mapping
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;column_mapping&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;product_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;product_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;product_name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;product_name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;category&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;category&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;price&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;price&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;stock_quantity&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;stock_quantity&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;last_updated&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;last_updated&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This mapping system is the key to flexibility. Your CSV can have any column names - the script translates them to match your database schema.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Bulk Database Insertion
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Convert DataFrame to a list of dictionaries (JSON format) for Supabase insertion
&lt;/span&gt;&lt;span class="n"&gt;records&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_dict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;orient&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;records&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Insert data into Supabase
&lt;/span&gt;&lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;supabase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;table&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;TABLE_NAME&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;insert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;records&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The script converts the cleaned data to JSON format and performs a bulk insert, which is much more efficient than individual row insertions.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Architecture: Clean and Modular
&lt;/h2&gt;

&lt;p&gt;The script follows a clean architecture pattern:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Configuration Layer&lt;/strong&gt;: Handles credentials and settings&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Processing Layer&lt;/strong&gt;: Cleans and transforms CSV data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database Layer&lt;/strong&gt;: Handles Supabase interactions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error Handling Layer&lt;/strong&gt;: Provides comprehensive error reporting&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This modular approach makes the code maintainable and easy to extend.&lt;/p&gt;

&lt;h2&gt;
  
  
  Security: Best Practices Implemented
&lt;/h2&gt;

&lt;p&gt;Security was a top priority in this project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Environment Variables&lt;/strong&gt;: All credentials stored in &lt;code&gt;.env&lt;/code&gt; files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Git Ignore&lt;/strong&gt;: &lt;code&gt;.env&lt;/code&gt; files never committed to version control&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Input Validation&lt;/strong&gt;: Data validated before database insertion&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error Handling&lt;/strong&gt;: Graceful failure without exposing sensitive information&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Performance: Optimized for Scale
&lt;/h2&gt;

&lt;p&gt;The script is designed for efficiency:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bulk Operations&lt;/strong&gt;: Single database transaction for all records&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory Efficient&lt;/strong&gt;: Processes data in chunks for large files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error Recovery&lt;/strong&gt;: Continues processing even if individual records fail&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🔧 Customization: Adapt to Any Use Case
&lt;/h2&gt;

&lt;p&gt;The beauty of this approach is its flexibility. Want to import customer data instead of products? Just update the column mapping:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;column_mapping&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;customer_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;customer_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;full_name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;email&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;email_address&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;phone&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;phone_number&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;city&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;location&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same script works for any tabular data!&lt;/p&gt;

&lt;h2&gt;
  
  
  Lessons Learned: What I'd Do Differently
&lt;/h2&gt;

&lt;p&gt;Building this project taught me several valuable lessons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Start with Security&lt;/strong&gt;: Environment variables should be the first thing you implement&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plan for Errors&lt;/strong&gt;: Comprehensive error handling saves hours of debugging&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Document Everything&lt;/strong&gt;: Good documentation makes your code accessible to others&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test with Real Data&lt;/strong&gt;: Always test with actual data, not just sample data&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Impact: Beyond Just Data Import
&lt;/h2&gt;

&lt;p&gt;This importer does more than just move data - it transforms your workflow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Time Savings&lt;/strong&gt;: What used to take hours now takes minutes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Quality&lt;/strong&gt;: Consistent cleaning and validation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability&lt;/strong&gt;: Handle any number of CSV files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reliability&lt;/strong&gt;: Automated process reduces human error&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Next Steps: What's Possible Now
&lt;/h2&gt;

&lt;p&gt;With your data cleanly stored in Supabase, you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Build Web Applications&lt;/strong&gt;: Query your data through Supabase's auto-generated APIs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create Dashboards&lt;/strong&gt;: Visualize your data with tools like Grafana or custom React apps&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set Up Real-time Updates&lt;/strong&gt;: Use Supabase's real-time features for live data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integrate with Other Services&lt;/strong&gt;: Connect to analytics tools, CRMs, or business intelligence platforms&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Code: Open Source and Available
&lt;/h2&gt;

&lt;p&gt;The complete source code is available on GitHub: &lt;a href="https://github.com/Coderanger08/csv-to-database" rel="noopener noreferrer"&gt;https://github.com/Coderanger08/csv-to-database&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The repository includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The main importer script&lt;/li&gt;
&lt;li&gt;Sample CSV data for testing&lt;/li&gt;
&lt;li&gt;Comprehensive documentation&lt;/li&gt;
&lt;li&gt;Setup instructions&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion: From Problem to Solution
&lt;/h2&gt;

&lt;p&gt;This project started as a simple need to import CSV data, but it became something much more valuable - a reusable, secure, and efficient data pipeline.&lt;/p&gt;

&lt;p&gt;The key insights:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Automation beats manual work&lt;/strong&gt; every time&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security should be built-in&lt;/strong&gt;, not an afterthought&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flexibility through configuration&lt;/strong&gt; makes tools more valuable&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Good documentation&lt;/strong&gt; multiplies the impact of your code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whether you're dealing with product inventories, customer data, or any other tabular information, having a reliable data import pipeline is a game-changer for productivity.&lt;/p&gt;

&lt;p&gt;The best part? This approach scales. As your data needs grow, the same principles apply. You might add more data sources, implement more sophisticated cleaning rules, or integrate with additional services - but the foundation remains solid.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;I'd love to hear about your data import challenges and how you've solved similar problems. Feel free to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Star the repository&lt;/strong&gt; if you find it useful&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open an issue&lt;/strong&gt; if you encounter any problems&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Submit a PR&lt;/strong&gt; if you have improvements to suggest&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Share your own solutions&lt;/strong&gt; in the comments below&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;About the Author&lt;/strong&gt;: I'm a developer passionate about building tools that solve real-world problems. You can find more of my projects on &lt;a href="https://github.com/Coderanger08" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; or connect with me on &lt;a href="https://linkedin.com/in/faisal-irfan-13417nf" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Related Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/Coderanger08/csv-to-database" rel="noopener noreferrer"&gt;GitHub Repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://supabase.com/docs" rel="noopener noreferrer"&gt;Supabase Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pandas.pydata.org/docs/" rel="noopener noreferrer"&gt;Pandas Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://python-dotenv.readthedocs.io/" rel="noopener noreferrer"&gt;Python-dotenv Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




</description>
      <category>database</category>
      <category>csv</category>
      <category>python</category>
      <category>datascience</category>
    </item>
    <item>
      <title>AI Chatbot with Role-Based Access Using Permit.io + Gemini (TIU ImpactHub Bot)</title>
      <dc:creator>Irfan Faisal</dc:creator>
      <pubDate>Sun, 04 May 2025 07:07:05 +0000</pubDate>
      <link>https://forem.com/coderanger08/ai-chatbot-with-role-based-access-using-permitio-gemini-tiu-impacthub-bot-2ma0</link>
      <guid>https://forem.com/coderanger08/ai-chatbot-with-role-based-access-using-permitio-gemini-tiu-impacthub-bot-2ma0</guid>
      <description>&lt;h2&gt;
  
  
  🌟 Project Overview
&lt;/h2&gt;

&lt;p&gt;This project is a university-focused chatbot built for the &lt;strong&gt;TIU Impact Hub&lt;/strong&gt; — a student-led innovation and leadership community at Tokyo International University in Japan.&lt;/p&gt;

&lt;p&gt;The chatbot is powered by &lt;strong&gt;Gemini AI&lt;/strong&gt;, and integrates &lt;strong&gt;Permit.io&lt;/strong&gt; to protect sensitive actions (like mass emailing) through fine-grained, externalized access control.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔐 Why Permit.io?
&lt;/h2&gt;

&lt;p&gt;Instead of hardcoding logic like &lt;code&gt;if user.role === 'admin'&lt;/code&gt;, I used &lt;strong&gt;Permit.io&lt;/strong&gt; for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Role-based access (admin vs visitor)&lt;/li&gt;
&lt;li&gt;✅ Externalized policy enforcement&lt;/li&gt;
&lt;li&gt;✅ A future-ready structure for more scalable AI commands (e.g., Discord posting, Slack messages)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💻 Live App or Local Testing Instructions
&lt;/h2&gt;

&lt;p&gt;This app currently runs locally (not yet deployed). You can easily test it with:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Backend&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd server
npm install
node server.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;** Frontend**&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd client
npm install
npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Test Accounts&lt;br&gt;
Please use the following credentials for testing:&lt;br&gt;
&lt;u&gt;Admin&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;userId: admin&lt;br&gt;
role: admin&lt;br&gt;
password: 2025DEVChallenge&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Visitor&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;userId: newuser&lt;br&gt;
role: visitor&lt;br&gt;
password: 2025DEVChallenge&lt;/p&gt;

&lt;p&gt;These values are passed to the backend in the request body and evaluated by Permit.io to allow or block AI actions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI Features&lt;/strong&gt;&lt;br&gt;
 Gemini AI chatbot: Responds only to TIU-related questions&lt;/p&gt;

&lt;p&gt;/send_email command: Sends emails to all members — admin-only&lt;/p&gt;

&lt;p&gt;Visitors are politely denied if they try restricted actions&lt;/p&gt;

&lt;p&gt;Key Code Samples&lt;br&gt;
 Access Control Enforcement&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const isAllowed = await checkPermission(userId, "send_email_to_members", role);
if (!isAllowed) {
  return res.json({ reply: "❌ You are not allowed to send emails." });
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Gemini Prompt Injection&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const systemPrompt = `
You are the official chatbot of TIU Impact Hub, a student-led innovation community...
Only answer questions related to TIU Impact Hub. Refuse politely otherwise.
`;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔗 GitHub Repo&lt;br&gt;
🔗 &lt;a href="https://github.com/Coderanger08/TIUIH_chatbot.git" rel="noopener noreferrer"&gt;https://github.com/Coderanger08/TIUIH_chatbot.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;** Reflection**&lt;br&gt;
Using Permit.io made it so easy to manage access control. It’s clean, centralized, and scalable — especially for future plans like posting to Discord or creating AI dashboards with more roles (mentor, manager, etc.).&lt;/p&gt;

&lt;p&gt;No more spaghetti-role-checks in code — just clean policy logic.&lt;/p&gt;

&lt;p&gt;Final Thoughts&lt;br&gt;
Thanks to the Permit.io team and DEV for this opportunity!&lt;br&gt;
I had fun building this and learned how to combine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Gemini AI (text generation)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Role-based access (externalized)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Real-world functionality (email)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>permitchallenge</category>
    </item>
    <item>
      <title>R Programming basics</title>
      <dc:creator>Irfan Faisal</dc:creator>
      <pubDate>Fri, 18 Apr 2025 01:37:44 +0000</pubDate>
      <link>https://forem.com/coderanger08/r-programming-basics-2oa9</link>
      <guid>https://forem.com/coderanger08/r-programming-basics-2oa9</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Quick notes on R&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Datatypes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3jua3q1exsyekmlx0qst.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3jua3q1exsyekmlx0qst.PNG" alt="R" width="800" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;typeof(x) or class(x)– both returns the data type of variable. however, typeof(x) is tend to be more specific&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x&amp;lt;-23.5
print(class(x))
&amp;gt;&amp;gt;&amp;gt;Numeric

print(typeof(x))
&amp;gt;&amp;gt;&amp;gt;double
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;length(x)– returns the length of a vector (list) or other objects: 1, or any other positive integer number. &lt;/p&gt;

&lt;p&gt;print(x)– prints the value of x in console&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;R Objects&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.&lt;strong&gt;Vector:&lt;/strong&gt; one-dimensional array containing elements of the same data type.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apple &amp;lt;- c('red','green',"yellow") #all character data types 
print(apple)

&amp;gt;&amp;gt;&amp;gt;red, green, yellow
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.&lt;strong&gt;List:&lt;/strong&gt; ordered collection of elements that can be of different data types.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;list1 &amp;lt;- list(c(2,5,3),21.3,5L) #contains vector, numeric, integer
print(list1)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.&lt;strong&gt;Matrix:&lt;/strong&gt;  a two-dimensional array where all elements must be of the same data type.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;M = matrix( c('a','a','b','c','b','a'), nrow = 2, ncol = 3, byrow = TRUE) print(M)
&amp;gt;&amp;gt;&amp;gt;
     [,1] [,2] [,3]
[1,] "a"  "a"  "b" 
[2,] "c"  "b"  "a" 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.&lt;strong&gt;Array:&lt;/strong&gt; a multi-dimensional data structure where all elements must be of the same data type.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a &amp;lt;- array(c('green','yellow'),dim = c(3,3,2)) 
print(a)

     [,1]     [,2]     [,3]    
[1,] "green"  "yellow" "green" 
[2,] "yellow" "green"  "yellow"
[3,] "green"  "yellow" "green" 

, , 2

     [,1]     [,2]     [,3]    
[1,] "yellow" "green"  "yellow"
[2,] "green"  "yellow" "green" 
[3,] "yellow" "green"  "yellow"

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5.&lt;strong&gt;Data Frame:&lt;/strong&gt; a two-dimensional, table-like structure where each column can hold data of a different type, making it similar to a spreadsheet or a SQL table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;BMI&amp;lt;-data.frame( gender = c("Male", "Male","Female"), 
height = c(152, 171.5, 165), 
weight = c(81,93, 78), 
Age = c(42,38,26) ) 

print(BMI)

&amp;gt;&amp;gt;&amp;gt;
  gender height weight Age
1   Male  152.0     81  42
2   Male  171.5     93  38
3 Female  165.0     78  26
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Operators&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;1.&lt;strong&gt;+&lt;/strong&gt;: adds two vectors.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v &amp;lt;-c( 2,5.5,6) 
t &amp;lt;-c(8, 3, 4) 
print(v+t)

&amp;gt;&amp;gt;[1] 10.0  8.5 10.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.&lt;strong&gt;-&lt;/strong&gt;: Subtracts second vector from the first&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v &amp;lt;-c( 2,5.5,6) 
t &amp;lt;-c(8, 3, 4) 
print(v-t)
&amp;gt;&amp;gt;[1] -6.0  2.5  2.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.*: Multiplies both vectors&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v &amp;lt;-c( 2,5.5,6) 
t &amp;lt;-c(8, 3, 4) 
print(v*t)
&amp;gt;&amp;gt;[1] 16.0 16.5 24.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.&lt;strong&gt;/&lt;/strong&gt;: Divide the first vector with the second&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v &amp;lt;-c( 2,5.5,6) 
t &amp;lt;-c(8, 3, 4) 
print(v/t)
&amp;gt;&amp;gt;[1] 0.250000 1.833333 1.500000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5.&lt;strong&gt;%%&lt;/strong&gt;: Give the remainder of the first vector with the second&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v &amp;lt;-c( 2,5.5,6) 
t &amp;lt;-c(8, 3, 4) 
print(v%%t)
&amp;gt;&amp;gt;[1] 2.0 2.5 2.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;6.&lt;strong&gt;%/%&lt;/strong&gt;: The result of division of first vector with second (quotient)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v &amp;lt;-c( 2,5.5,6) 
t &amp;lt;-c(8, 3, 4) 
print(v%/%t)
&amp;gt;&amp;gt;[1] 0 1 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;7.&lt;strong&gt;^&lt;/strong&gt;: The first vector raised to the power of second vector&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v &amp;lt;-c( 2,5.5,6) 
t &amp;lt;-c(8, 3, 4) 
print(v^t)
&amp;gt;&amp;gt;[1]  256.000  166.375 1296.000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Relational Operators&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;1.&lt;strong&gt;&amp;gt;&lt;/strong&gt;: Checks if each element of the first vector is greater than the corresponding element of the second vector&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v &amp;lt;-c(2,5.5,6,9) 
t &amp;lt;-c(8,2.5,14,9) 
print(v&amp;gt;t)
&amp;gt;&amp;gt;[1] FALSE  TRUE FALSE FALSE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.&lt;strong&gt;&amp;lt;&lt;/strong&gt;: Checks if each element of the first vector is less than the corresponding element of the second vector.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v &amp;lt;-c(2,5.5,6,9) 
t &amp;lt;-c(8,2.5,14,9) 
print(v &amp;lt; t)
&amp;gt;&amp;gt;[1]  TRUE FALSE  TRUE FALSE

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.&lt;strong&gt;==&lt;/strong&gt;: Checks if each element of the first vector is equal to the corresponding element of the second vector.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v &amp;lt;-c(2,5.5,6,9) 
t &amp;lt;-c(8,2.5,14,9) 
print(v == t)
&amp;gt;&amp;gt;[1] FALSE FALSE FALSE  TRUE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.&lt;strong&gt;&amp;lt;=&lt;/strong&gt;: Checks if each element of the first vector is less than or equal to the corresponding element of the second vector.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v &amp;lt;-c(2,5.5,6,9) 
t &amp;lt;-c(8,2.5,14,9) 
print(v&amp;lt;=t)
&amp;gt;&amp;gt;[1]  TRUE FALSE  TRUE  TRUE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5.&lt;strong&gt;!=&lt;/strong&gt;: Checks if each element of the first vector is unequal to the corresponding element of the second vector.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v &amp;lt;-c(2,5.5,6,9) 
t &amp;lt;-c(8,2.5,14,9) 
print(v!=t)
&amp;gt;&amp;gt;[1]  TRUE  TRUE  TRUE FALSE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Miscellaneous Operators&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;1.&lt;strong&gt;:&lt;/strong&gt;: Colon operator. It creates the series of numbers in sequence for a vector.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v &amp;lt;-1:8 
print(v)
&amp;gt;&amp;gt;[1] 1 2 3 4 5 6 7 8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.&lt;strong&gt;%in%&lt;/strong&gt;: This operator is used to identify if an element belongs to a vector.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v1 &amp;lt;-8 
v2 &amp;lt;-12 
t &amp;lt;-1:10 
print(v1 %in% t) 
print(v2 %in% t)
&amp;gt;&amp;gt;[1] TRUE
[1] FALSE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;%*%&lt;/strong&gt;: This operator is used to multiply a matrix with its transpose.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;M = matrix( c(2,6,5,1,10,4), nrow= 2,ncol = 3,byrow = TRUE) 
Q = M %*% t(M) 
print(Q)
&amp;gt;&amp;gt;
     [,1] [,2]
[1,]   65   82
[2,]   82  117
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Condition&lt;/strong&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x &amp;lt;- c("what","is","truth") 
if("Truth" %in% x) {
 print("Truth is found the first time") 
} else if ("truth" %in% x) {
 print("truth is found the second time") 
} else { print("There is no Truth in your code ")
 }
&amp;gt;&amp;gt;[1] "truth is found the second time"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  For Loop
&lt;/h2&gt;

&lt;p&gt;A For loop is a repetition control structure that allows you to efficiently write a loop that needs to execute a specific number of times.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a=c(1:5) 
for ( i in a) 
 {
 print(i) 
}
&amp;gt;&amp;gt;
1
2
3
4
5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  While Loop
&lt;/h2&gt;

&lt;p&gt;The While loop executes the same code again and again until a stop condition is met.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;v ="Hello, while loop" 
cnt = 2 
while (cnt &amp;lt; 7) {
 print(v) 
cnt = cnt + 1 
}
&amp;gt;&amp;gt;
[1] "Hello, while loop"
[1] "Hello, while loop"
[1] "Hello, while loop"
[1] "Hello, while loop"
[1] "Hello, while loop"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Next:&lt;/strong&gt; to skip the current iteration of a loop without terminating it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Break:&lt;/strong&gt; the loop is immediately terminated&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Basic Functions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1) readline(): to get input from user&lt;br&gt;
2) as.integer(): converts into integer&lt;br&gt;
3) as.numeric(): converts into numeric&lt;/p&gt;

</description>
      <category>rprogramming</category>
      <category>tutorial</category>
      <category>basic</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Power Automate: Automate your life pt.2</title>
      <dc:creator>Irfan Faisal</dc:creator>
      <pubDate>Tue, 15 Apr 2025 02:59:38 +0000</pubDate>
      <link>https://forem.com/coderanger08/power-automate-automate-your-life-pt2-4hmg</link>
      <guid>https://forem.com/coderanger08/power-automate-automate-your-life-pt2-4hmg</guid>
      <description>&lt;p&gt;Hi everyone! This is the part 2 of our Power automate tutorial series. In this tutorial, we'll talk about the rest of the tutorial.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;3) Time Tracking &amp;amp; Activity Logging&lt;/u&gt;&lt;br&gt;
Track how long you use certain apps (e.g., Word, VS Code) and log the usage to a file for productivity analysis.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;4) Clipboard &amp;amp; Text Automation&lt;/u&gt;&lt;br&gt;
Monitor what you copy, log it to a file, or turn it into quick notes — perfect for saving research highlights or repetitive text snippets.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;5) Automate Routine Daily Tasks&lt;/u&gt;&lt;br&gt;
Schedule PAD flows to run automatically at specific times (like launching your planner at 7 AM or logging reflections at 10 PM), so your day starts and ends with focus — without you doing anything manually.&lt;/p&gt;

&lt;p&gt;Let's start!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Tutorial 3: Time Tracking &amp;amp; Activity Logging&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In this tutorial, we'll make a power automate flow that will track how long a specific app(e.g., VS Code) is running, and log the total usage time to a .txt file automatically when it closes. This is perfect for tracking study time, coding sessions, or focused work blocks. Now let's get started!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 1: Create a New Flow&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Power Automate Desktop&lt;/li&gt;
&lt;li&gt;Click New Flow&lt;/li&gt;
&lt;li&gt;Name it: Track VS Code Usage and click Create&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;STEP 2: Get Start Time&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Search: Get current date and time&lt;/li&gt;
&lt;li&gt;Drag it to the top&lt;/li&gt;
&lt;li&gt;Save it as: StartTime&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;STEP 3: Wait Until App (e.g., VS Code) Closes&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Search: "Wait for process to end"&lt;/li&gt;
&lt;li&gt;Drag it under StartTime&lt;/li&gt;
&lt;li&gt;Set:
Process name: Code.exe (for VS Code — change for other apps)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This step pauses the flow until VS Code is closed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 4: Get End Time&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Search: Get current date and time&lt;/li&gt;
&lt;li&gt;Save it as: EndTime&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;STEP 5: Calculate Time Difference&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Search: "Subtract dates"&lt;/li&gt;
&lt;li&gt;Set:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;From date: %EndTime%&lt;/p&gt;

&lt;p&gt;Subtract date: %StartTime%&lt;/p&gt;

&lt;p&gt;Get difference in: Minutes&lt;/p&gt;

&lt;p&gt;This gives you the time spent using the app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 6: Format the log entry&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use Set Variable&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Name: LogEntry&lt;/p&gt;

&lt;p&gt;Value: Used VS Code for %TimeDifference% minute(s) on %StartTime%&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 7: Append to a Log File&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Action: Append line to text file&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;File path: e.g., C:\Users\YourName\Documents\usage_log.txt&lt;/p&gt;

&lt;p&gt;Text to append: %LogEntry%&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvfadvdwl7rl9qe5q3lef.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvfadvdwl7rl9qe5q3lef.PNG" alt="Track Usage" width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well Done! Now every time you run this flow, It waits for you to open VS Code then times how long it's running then logs the result once you close the app!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Tutorial 4: Clipboard &amp;amp; Text Automation&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In this tutorial, we will build an automation flow that will monitor what you copy (Ctrl+C), and log each copied text into a .txt file — perfect for saving useful links, research notes, or ideas on the go.&lt;/p&gt;

&lt;p&gt;Now let's get started!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 1: Create a New Flow&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Power Automate Desktop&lt;/li&gt;
&lt;li&gt;Click New Flow&lt;/li&gt;
&lt;li&gt;Name it: Clipboard Logger and click Create&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;STEP 2: Initialize LastClipboardText (Before Loop)&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Action: Set Variable&lt;/li&gt;
&lt;li&gt;Name: LastClipboardText&lt;/li&gt;
&lt;li&gt;Value: "" (empty string)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This ensures we have something to compare against — and it must be before the loop, not inside.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 3: Create a Loop That Keeps Running&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Search: Loop and choose: Loop condition&lt;/li&gt;
&lt;li&gt;Condition:
First operand: 1
Operator: equals
Second operand: 1&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This creates an infinite loop to keep checking clipboard content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 4: Get Current Clipboard Text&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Inside the loop, search for: Get clipboard text&lt;/li&gt;
&lt;li&gt;Drag it inside the loop&lt;/li&gt;
&lt;li&gt;Save output to: %ClipboardText%&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;STEP 5: Compare With Previously Saved Text&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We don’t want to log duplicate clipboard values — so let’s compare with the last copied text.&lt;/p&gt;

&lt;p&gt;Inside Loop: Check if New Text ≠ Last Text&lt;br&gt;
   Action: If&lt;br&gt;
   First operand: %ClipboardText%&lt;br&gt;
   Operator: Does not equal&lt;br&gt;
   Second operand: %LastClipboardText%&lt;/p&gt;

&lt;p&gt;This ensures only new copied text gets logged.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 6: Log the Clipboard Text&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Inside the If block:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Get Current Date &amp;amp; Time&lt;/p&gt;

&lt;p&gt;Action: Get current date and time&lt;br&gt;
Output variable: CurrentTime&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Format Log Entry&lt;/p&gt;

&lt;p&gt;Action: Set Variable&lt;br&gt;
Name: LogEntry&lt;br&gt;
Value: %CurrentTime% — %ClipboardText%&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Append to a File&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;i. search for action: Write text to file&lt;br&gt;
   ii. Drag it into your flow inside the If block (after Set LogEntry)&lt;br&gt;
   iii. set value like this:&lt;/p&gt;

&lt;p&gt;File path: C:\Users\YourName\Documents\clipboard_log.txt&lt;br&gt;
   Text to write: %LogEntry%&lt;br&gt;
   Append content to existing file: ✔️ Check this box&lt;br&gt;
   If file exists: Append content to existing file&lt;br&gt;
   Encoding: Unicode or UTF-8 (both fine)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Update LastClipboardText&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Action: Set Variable&lt;br&gt;
   Variable: LastClipboardText&lt;br&gt;
   Value: %ClipboardText%&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 7: Add a Short Delay to Avoid Overload&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Action: Delay&lt;/li&gt;
&lt;li&gt;Duration: 2 seconds (or even 1)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0qanbc7tr7ymue7temng.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0qanbc7tr7ymue7temng.PNG" alt="Clipboard logger" width="623" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Done! Now this turns your clipboard into a smart, passive note-taker. Anytime you copy something — a quote, code snippet, research point, or idea — it’s automatically saved to a log file with a timestamp, without interrupting your workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Tutorial 5: Automate Routine Daily Tasks&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In our daily lives, we need to use many software on a frequent basis. For example, Google Calendar, Notes, Notion, Weather etc. In this tutorial, we'll build an automation flow that will automatically start your productivity apps at specific times without the need for manual setup. &lt;/p&gt;

&lt;p&gt;Let's get started!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Create the Flow in PAD&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Power Automate Desktop&lt;/li&gt;
&lt;li&gt;Click New Flow&lt;/li&gt;
&lt;li&gt;Name it "Launch Daily Planner" and click create.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Open Google Calendar&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Search: Launch new Chrome&lt;/li&gt;
&lt;li&gt;Drag into your flow&lt;/li&gt;
&lt;li&gt;Set:
URL: &lt;a href="https://calendar.google.com" rel="noopener noreferrer"&gt;https://calendar.google.com&lt;/a&gt;
Window state: Normal
Target Desktop: Local Computer&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;**Step 3: Open Weather Forecast&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Search: Launch new Chrome&lt;/li&gt;
&lt;li&gt;Drag it below the first Chrome action&lt;/li&gt;
&lt;li&gt;Set:
URL: &lt;a href="https://weather.com/weather/today/l/your-location-code" rel="noopener noreferrer"&gt;https://weather.com/weather/today/l/your-location-code&lt;/a&gt;
(You can use your city or Google Weather like 
&lt;a href="https://www.google.com/search?q=weather+tokyo" rel="noopener noreferrer"&gt;https://www.google.com/search?q=weather+tokyo&lt;/a&gt;)
Window state: Normal
Target Desktop: Local Computer&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Open Notepad&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Search: Run application&lt;/li&gt;
&lt;li&gt;Drag into the flow&lt;/li&gt;
&lt;li&gt;Set:
Application path: C:\Windows\System32\notepad.exe&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Save Your Flow&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click the Save icon (💾) in the top bar&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyummhebejtgulbosc73w.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyummhebejtgulbosc73w.PNG" alt="Daily Planner" width="800" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well done! Now whenever you run this flow, this will automatically open Google Calendar, A weather page or Notepad with your to-do list and you won't have to open these programs manually!&lt;/p&gt;

&lt;p&gt;That's it! We have successfully completed 5 amazing automation flows using Power Automate to automate your daily life. Now you can navigate your daily life in a more smarter way! Do these projects and amaze your friends. &lt;/p&gt;

&lt;p&gt;Let me know if you have any questions or feedbacks in the comments. Happy Learning!&lt;/p&gt;

</description>
      <category>powerautomate</category>
      <category>automation</category>
      <category>microsoft</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Power Automate: Automate your life pt.1</title>
      <dc:creator>Irfan Faisal</dc:creator>
      <pubDate>Sun, 13 Apr 2025 05:26:11 +0000</pubDate>
      <link>https://forem.com/coderanger08/power-automate-automate-your-life-pt1-2f2l</link>
      <guid>https://forem.com/coderanger08/power-automate-automate-your-life-pt1-2f2l</guid>
      <description>&lt;p&gt;Power Automate is a tool by Microsoft that lets you automate repetitive tasks across your computer and cloud apps — without writing code.&lt;/p&gt;

&lt;p&gt;It comes in two versions:&lt;/p&gt;

&lt;p&gt;A) Power Automate (Cloud) – automates tasks between services like Outlook, Excel, Teams, Google Drive, etc.&lt;/p&gt;

&lt;p&gt;B) Power Automate for Desktop (PAD) – automates tasks on your local computer, like opening apps, organizing files, clicking buttons, or filling out forms.&lt;/p&gt;

&lt;p&gt;As we all are very busy in our lives, automation will surely help us to catch a break. To automate your daily lives, Power Automate by Microsoft will work like a charm. In this tutorial, we'll focus on Power Automate for Desktop (PAD). Here is a list of use cases of PAD:&lt;/p&gt;

&lt;p&gt;&lt;u&gt;1) File &amp;amp; Folder Organization&lt;/u&gt;&lt;br&gt;
Automatically move, rename, or sort files in your Downloads or Documents folder based on type, date, or name.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;2) Break Reminders &amp;amp; Daily Notifications&lt;/u&gt;&lt;br&gt;
Show pop-up messages at scheduled times (e.g., every 2 hours) to remind you to take breaks, hydrate, or refocus.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;3) Time Tracking &amp;amp; Activity Logging&lt;/u&gt;&lt;br&gt;
Track how long you use certain apps (e.g., Word, VS Code) and log the usage to a file for productivity analysis.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;4) Automate Routine Daily Tasks&lt;/u&gt;&lt;br&gt;
Schedule PAD flows to run automatically at specific times (like launching your planner at 7 AM or logging reflections at 10 PM), so your day starts and ends with focus — without you doing anything manually.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;5) Clipboard &amp;amp; Text Automation&lt;/u&gt;&lt;br&gt;
Monitor what you copy, log it to a file, or turn it into quick notes — perfect for saving research highlights or repetitive text snippets.&lt;/p&gt;

&lt;p&gt;In this tutorial, I will show you how to do all of these in Power Automate for Desktop.&lt;/p&gt;

&lt;p&gt;But first,&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;System Configuration:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Windows Operating System&lt;br&gt;
Windows 10 (Pro, Enterprise, or Education) or 11&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install Power Automate for Desktop&lt;br&gt;
Download from the official Microsoft site:&lt;br&gt;
&lt;a href="https://powerautomate.microsoft.com/desktop" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Microsoft Account (Optional but Recommended)&lt;br&gt;
Needed if you want to:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Sync with Power Automate cloud flows&lt;/p&gt;

&lt;p&gt;You can still use PAD locally without logging in&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Internet Connection
Required for installation, updates, and integration with cloud services&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Not needed for running offline desktop flows (like file organization, launching apps, etc.)&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Tutorial 1: File &amp;amp; Folder Organizer&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In this tutorial we’ll build a File &amp;amp; Folder Organizer that automatically cleans up your Downloads folder by moving files into categorized folders based on their file type.&lt;/p&gt;

&lt;p&gt;📄 PDFs → Documents\PDFs&lt;br&gt;
🖼️ Images → Pictures\Screenshots&lt;br&gt;
🗜️ ZIP/EXE → Downloads\Installers&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 1: Create a New Flow&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Power Automate Desktop&lt;/li&gt;
&lt;li&gt;Click New Flow&lt;/li&gt;
&lt;li&gt;Name it: Organize Downloads and click Create&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;STEP 2: Set the Source Folder&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Search: Get files in folder&lt;/li&gt;
&lt;li&gt;Drag it into the flow&lt;/li&gt;
&lt;li&gt;Set:
Folder path: C:\Users\YOURNAME\Downloads
File Filter: 
   Only move images -&amp;gt; &lt;em&gt;.jpg;&lt;/em&gt;.png;&lt;em&gt;.jpeg
   Only sort PDFs -&amp;gt; *.pdf
   Only install files -&amp;gt; *.exe;&lt;/em&gt;.zip
   All files -&amp;gt; Leave blank or &lt;em&gt;.&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Include subfolders: ❌ (Uncheck)&lt;br&gt;
   Save to variable: DownloadedFiles&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 3: Loop Through Each File&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Search: For each&lt;/li&gt;
&lt;li&gt;Drag For Each into the flow&lt;/li&gt;
&lt;li&gt;Set:
Value to iterate: %DownloadedFiles%
Variable name: CurrentFile&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;STEP 4: Check File Type and Move&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Inside the loop, add "If" condition blocks to detect the file extension:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;First operand -&amp;gt; Text.EndsWith(%CurrentFile%, ".png") OR &lt;br&gt;
                 Text.EndsWith(%CurrentFile%, ".jpg") OR &lt;br&gt;
                 Text.EndsWith(%CurrentFile%, ".jpeg") OR&lt;br&gt;
                 Text.EndsWith(%CurrentFile%, ".zip") OR &lt;br&gt;
                 Text.EndsWith(%CurrentFile%, ".exe") &lt;/p&gt;

&lt;p&gt;Operator -&amp;gt; leave default (it becomes a full expression)&lt;br&gt;
Second operand -&amp;gt; (leave blank — not needed in this format)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add the Move File Action Inside the If Block&lt;/li&gt;
&lt;li&gt;Search "Move File" and drag inside if block&lt;/li&gt;
&lt;li&gt;Fill in like this:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;File to move: %CurrentFile%&lt;br&gt;
Destination folder: C:\Users\YourName\Documents\PDFs (or Pictures\Screenshots, etc.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 5: Save &amp;amp; Test&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click Save&lt;/li&gt;
&lt;li&gt;Run the flow with a messy Downloads folder 🎯&lt;/li&gt;
&lt;li&gt;Watch files move into their proper folders automatically!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmm0ct22c77xwkljnau1u.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmm0ct22c77xwkljnau1u.PNG" alt="Folder Organizer" width="800" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Tutorial 2: Automate  Break Reminders &amp;amp; Daily Notifications&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Our automation will show a popup message every 1 hour during the day that reminds you to:&lt;/p&gt;

&lt;p&gt;💡 "Time for a break! Stand up, stretch, drink water, and breathe."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Create a New Flow&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Power Automate for Desktop&lt;/li&gt;
&lt;li&gt;Click New Flow (at left above)&lt;/li&gt;
&lt;li&gt;Name it: Break Timer Reminder nad click Create&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;STEP 2: Add a Loop to Repeat Forever&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the left panel, search for "Loop condition"&lt;/li&gt;
&lt;li&gt;Drag it into your flow&lt;/li&gt;
&lt;li&gt;Fill in like this: [First Operand=1, Operator=equals, Second Operand=1]&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This creates an infinite loop that keeps running until you stop it manually.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 3: Add a 2-Hour Wait Inside the Loop&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Inside the loop, drag in the action "Wait"&lt;/li&gt;
&lt;li&gt;Set: [Duration: 3600, Unit: Seconds]&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This will pause the flow for 1 hour before the next reminder.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 4: Add the Break Reminder Message&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Drag the action Display message below the Wait, still inside the loop.&lt;/li&gt;
&lt;li&gt;Fill it out:
[Title: Break Reminder,
Message:💡 Time for a break!\nStand up, stretch, drink water, and breathe.
Icon: Information
Buttons: OK]&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;STEP 5: Save and Test Your Flow&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click the Save icon (💾)&lt;/li&gt;
&lt;li&gt;Click Run ▶️ to test it&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;From here, it will wait 1 hour, then show the message forever — unless you stop the flow.&lt;/p&gt;

&lt;p&gt;Done! You now have a personalized automated wellness assistant reminding you to take breaks!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpxhpf9hxf9uejbhffyli.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpxhpf9hxf9uejbhffyli.PNG" alt="Break Time Reminder" width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These two tutorials are for today. In the next tutorial, we'll talk about the rest of the tutorials. &lt;/p&gt;

&lt;p&gt;If you have any questions or feedbacks, let me know in the comments. Happy Learning!&lt;/p&gt;

</description>
      <category>powerautomate</category>
      <category>automation</category>
      <category>tutorial</category>
      <category>microsoft</category>
    </item>
    <item>
      <title>Python Basics 7: String part 2- String Functions and ASCII Code</title>
      <dc:creator>Irfan Faisal</dc:creator>
      <pubDate>Mon, 27 Jan 2025 09:15:31 +0000</pubDate>
      <link>https://forem.com/coderanger08/python-basics-7-string-part-2-string-functions-and-ascii-code-4d32</link>
      <guid>https://forem.com/coderanger08/python-basics-7-string-part-2-string-functions-and-ascii-code-4d32</guid>
      <description>&lt;p&gt;There are a number of functions in python string library. String functions don't change the string itself, they return a modified string. These functions saves us a lot of time.&lt;/p&gt;

&lt;p&gt;Syntax: string_name.function_name()&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;lower():&lt;/strong&gt; returns a copy string with all lower case letter.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;line='Hello World'
temp= line.lower()
print(temp)
&amp;gt;&amp;gt; hello world
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;upper():&lt;/strong&gt; returns a copy string with all upper case letter.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;text = 'Hello World'
temp = text.upper()
print(temp)

Output:
HELLO WORLD

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Capitalize():&lt;/strong&gt; capitalize the first letter of the string
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;s="python is fun"
c=s.capitalize()
print(c)
&amp;gt;&amp;gt;Python is fun
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;title():&lt;/strong&gt; capitalize each word of the title(string)
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;s="hello world"
c=s.title()
print(c)
&amp;gt;&amp;gt;Hello World
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;strip():&lt;/strong&gt; returns a copy string with all whitespace removed before and after letters.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;text = '   Hello    World
   '
temp = text.strip()
print(text)
print(temp)

Output:
   Hello    World  
Hello   World
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;lstrip():&lt;/strong&gt; Returns a copy string with all whitespace remove before(left side) letters.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;text = '    Hello   World
    '
temp = text.lstrip()
print(text)
print(temp)

Output:
    Hello     World 
Hello   World   

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;rstrip():&lt;/strong&gt; Returns a copy string with all whitespace remove after(right side) letters.
Ex:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; text = '     Hello     World
    '
temp = text.lstrip()
print(text)
print(temp)

Output:
    Hello     World 
    Hello     World

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;count(substring):&lt;/strong&gt; returns total occurrence of that substring,
Ex:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;text = 'Banana'
temp = text.count('a')
print(text)
print(temp)

Output:
Banana
3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;startswith(substring):&lt;/strong&gt; returns True if the string starts with given substring.
Ex:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;text = 'Hello'
temp = text.startswith('He')
print(text)
print(temp)

Output:
Hello
True

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;endswith(substring):&lt;/strong&gt; returns True if the string ends with the given substring.
Ex:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
text = 'Hello'
temp =text.endswith('hi')
print(text)
print(temp)

Output:
Hello
False
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;find(substring):&lt;/strong&gt; returns the index of first occurrence of that substring.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ex:
text = 'Banana'
temp = text.find('a')
print(text)
print(temp)

Output:
Banana
1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;replace(oldstring, newstring):&lt;/strong&gt; replace every instance of oldstring with new string.
Ex:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;text = 'Hello'
temp = text.replace('l','nt')
print(text)
print(temp)
Output:

Hello
Hentnto

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;u&gt;dir('This is a string') / dir(' ')&lt;/u&gt;&lt;/strong&gt;:Get to see all the string functions present in python.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;You can use two methods together.&lt;/u&gt;&lt;br&gt;
&lt;code&gt;Name=name.strip().title()&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  ASCII Code
&lt;/h2&gt;

&lt;p&gt;=&amp;gt; Machines do not understand text, not even decimals. Machines just understand binary.&lt;br&gt;
If we write "a"(string), it won't understand. To understand, machines convert them into binary. In that case, to convert string into binary, we first need to convert strings into numbers. So then comes ASCII.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;ASCII (American Standard Code for Information Interchange)&lt;/u&gt; is a code for representing English characters as numbers assigned from 0 to 127.&lt;/p&gt;
&lt;h3&gt;
  
  
  ord and chr
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Ord:&lt;/strong&gt; ord function returns the corresponding ASCII value of a character.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ord('a')
&amp;gt;&amp;gt; 97

Ord('b')
&amp;gt;&amp;gt; 98
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Chr:&lt;/strong&gt; chr function returns the corresponding string of a number.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Chr(97)
&amp;gt;&amp;gt;a

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;ASCII Code Table&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftt15c6iatqtq6eyc37dz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftt15c6iatqtq6eyc37dz.jpg" alt="ASCII Table" width="800" height="476"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Problem&lt;/strong&gt;&lt;br&gt;
Now, we'll try to use our knowledge of functions and ASCII code with an example problem. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Problem:&lt;/em&gt; In this problem, you'll ask the user for writing something in uppercase and your code will return the same text in lowercase. Here we're expecting that the user will provide a text and nothing else.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution 1: Using default .lower() function&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def uppercase_to_lowercase():

    #Prompts the user to input text in uppercase and prints the text in lowercase.

    uppercase = input("Write something in uppercase: ")
    lowercase = uppercase.lower()
    print(lowercase)

# Call the function
uppercase_to_lowercase()


#output
#Write something in uppercase: "HELLO,WORLD!"
#hello,world!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Solution 2:Without using default .lower() function&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now, let's try to solve this problem in a different way. This time we'll not use the default .lower() function. You may ask why we need to solve this problem without the default function whereas default function is there to make our life easier. That's true but it's also a nice practice to understand how these default function works. When you understand the core mechanics of these functions it will develop your programming skill.&lt;/p&gt;

&lt;p&gt;So, we'll try to convert our text into lowercase using ASCII value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;test="MICROsoft"
lower=""
for i in test:
  if 65&amp;lt;=ord(i)&amp;lt;=90:
    lower+=chr(ord(i)+32)
  else:
    lower+=i
print(lower)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This solution will work even if there's any small letters in the capitalized string.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Brainstorm:&lt;/strong&gt; Think about why we have done additon of 32 in the code? Look at the ASCII code picture to think about&lt;/p&gt;

&lt;p&gt;So, this is all for today. I hope now you can use the string default functions whenever you need. And you also have an idea how to solve problem even if you dont know the functions using ASCII code. Happy coding!&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Python Basics 7: String part 1- Introduction</title>
      <dc:creator>Irfan Faisal</dc:creator>
      <pubDate>Wed, 14 Aug 2024 10:05:10 +0000</pubDate>
      <link>https://forem.com/coderanger08/python-basics-7-string-part-1-introduction-4hne</link>
      <guid>https://forem.com/coderanger08/python-basics-7-string-part-1-introduction-4hne</guid>
      <description>&lt;h2&gt;
  
  
  What is String?
&lt;/h2&gt;

&lt;p&gt;=&amp;gt; String is a &lt;u&gt;sequence of ordered characters&lt;/u&gt;(alphabets-lower case, upper case, numeric values, special symbols etc.) in a program.&lt;/p&gt;

&lt;p&gt;It is &lt;u&gt;represented with quotation marks&lt;/u&gt;(single('), double(") or triple(' ' '/" " ") at the beginning and the end. You can use either one you want.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;"Hello World"&lt;br&gt;
'CSE is awesome'&lt;br&gt;
"Not a valid string'(must follow one type of quotation marks)&lt;/p&gt;
&lt;h2&gt;
  
  
  String inside a string
&lt;/h2&gt;

&lt;p&gt;To write a string inside a string, you need to use different types of quotation marks. It means that if you have a substring inside a string that is surrounded by double quotation marks, then use single quotation mark to represent the main string and vice versa.&lt;/p&gt;

&lt;p&gt;Ex:  "This is a valid 'string' because it maintains the order"&lt;br&gt;
        'String inside a 'string' like this not allowed'&lt;/p&gt;

&lt;p&gt;You can also use 'Escape Sequence' for that:&lt;br&gt;
*If you have some special character inside your string that might confuse the interpreter, you can use 'Escape sequence' to clarify. Escape sequence tells the interpreter to consider the character following the backslash as a printable character.&lt;/p&gt;

&lt;p&gt;Ex: "I love the movie \"Shang-chi\" "&lt;br&gt;
     'She said that Aren\'t you going to late for work?'&lt;/p&gt;
&lt;h3&gt;
  
  
  More facts about string:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A single character is also a string.
Ex: "P", 'P' &lt;/li&gt;
&lt;li&gt;String is case sensitive.
Ex: "A" and 'a' are two different strings.
&lt;/li&gt;
&lt;li&gt; Space is also a string.
Ex: " " and ' ' are strings.
&lt;/li&gt;
&lt;li&gt;Empty string- where nothing is between the quotation marks.
Ex: "" and ''&lt;/li&gt;
&lt;li&gt;"1" is not an integer, it's a string!&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  String Mutability:
&lt;/h2&gt;

&lt;p&gt;This is a very important concept of string. &lt;u&gt;Strings are immutable.&lt;/u&gt; Once a string is created the characters in it can't be changed/deleted/altered. So each time we have to modify a string, we need to make a copy of the original one and make changes to the duplicate one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Sentence= "Loving CSE110'

Sentence[0]= "M"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;TypeError: 'str' doesn't support item alignment.(here, we're trying to change the string but we can't alter any of the characters in the string)&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;

&lt;p&gt;*However, we can change the entire string.&lt;/p&gt;

&lt;p&gt;s='I am Baymax'&lt;/p&gt;

&lt;p&gt;Print(s)&lt;br&gt;
s='I am Superman'&lt;br&gt;
Print(s)=&amp;gt; Here, we have stored a completely different string in s variable.&lt;/p&gt;
&lt;h3&gt;
  
  
  Deletion
&lt;/h3&gt;

&lt;p&gt;'del' = keyword to unbind reference to a string, It will delete a string from its variable.&lt;/p&gt;

&lt;p&gt;Ex:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;s='I love CSE'

Print(s)
Del(s)
Print(s)

&amp;gt;&amp;gt;&amp;gt; I love CSE
Error


*We can't delete a character from a string.

s='I am 007'
 del(s[0])

&amp;gt;&amp;gt;&amp;gt; ERROR
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  String Membership
&lt;/h2&gt;

&lt;p&gt;We can use 'in' keyword to find if there is occurrence of any substring in a given string(whether a string is present inside another string or not).&lt;/p&gt;

&lt;p&gt;Ex:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;'bay' in 'ebay'
&amp;gt;&amp;gt;True
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;'bay' not in 'ebay'
&amp;gt;&amp;gt;False
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*It can be used in 'if statement' as condition.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;S1= 'I am Loki'
S2='am'
If S2 in S1:
    Print(found)
Else:
    Print(not found)

&amp;gt;&amp;gt;&amp;gt;found
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is all for today about string. In next part, we'll discuss more about string and it's functions. Then we'll try to solve some problems. Till then, keep practicing. Happy coding!&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Python Basics 6: Loops part 2</title>
      <dc:creator>Irfan Faisal</dc:creator>
      <pubDate>Sun, 11 Aug 2024 23:15:46 +0000</pubDate>
      <link>https://forem.com/coderanger08/python-loops-2-215g</link>
      <guid>https://forem.com/coderanger08/python-loops-2-215g</guid>
      <description>&lt;p&gt;Hello everyone! This is our 2nd part of python loop series. &lt;br&gt;
Part 1 is here:&lt;br&gt;
&lt;a href="https://dev.to/coderanger08/python-loops-1-5dho"&gt;https://dev.to/coderanger08/python-loops-1-5dho&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this week, we'll discuss more about while and for loop, break and pass statements, range function and many more. Let's get started.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Infinite Loop:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;An infinite loop is a scenario when a loop runs indefinitely because the condition is always true(while) or the sequence never ends(for). Infinite loop will run forever when the terminating condition has never been met.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;count=5
while count&amp;gt;=1:
    print(count)
    count+=1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This while loop is an infinite loop. Think why?&lt;/p&gt;

&lt;p&gt;Technically, an infinite loop is a bug(error). You can stop infinite loop manually by terminating the program or using break statement.&lt;br&gt;
However, sometimes infinite loop can be useful in many ways.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Web servers and background services use infinite loops to continuously listen for and handle requests.&lt;/li&gt;
&lt;li&gt;Infinite loops in game keep the game running, updating the game state, and rendering frames until the player exits.&lt;/li&gt;
&lt;li&gt;Command Line Interfaces (CLIs) use infinite loops to repeatedly prompt the user for input until they choose to exit.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Break Statement&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To stop an infinite loop or an usual loop, you can use the break statement.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;count=1
while count&amp;gt;=1:
    print(count)
    count+=1
    if count==5:
        break #this will stop the loop here

&amp;gt;&amp;gt;1
2
3
4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Continue Statement
&lt;/h3&gt;

&lt;p&gt;Continue is a little different way to stop a loop. By using continue, you can stop or skip the loop only for that iteration. The loop will start to run again from next iteration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;flowers=["lily","orchid","rose","jasmine"]
for element in flowers:
   if element=="rose":
       continue #it won't print rose
   print(element)

&amp;gt;&amp;gt;
lily
orchid
jasmine
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Pass Statement&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If we want to write the codes in a (if/else statement, loop block) later, it'll show an error because of empty block. In that case, we can use pass statement. It'll pass that instructions and move on to the next part.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pass statement is a null statement.&lt;/li&gt;
&lt;li&gt;Interpreter does not ignore a pass statement&lt;/li&gt;
&lt;li&gt;Empty code is not allowed in loops, function definitions, class definitions or in if statements. To avoid error we use pass statement.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ex:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Nums=[1,2,3,4,5]
For val in nums:
    Pass    #it will pass the iteration and won't execute anything
#other lines of the code 

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Else Statement in a loop:&lt;/strong&gt;&lt;br&gt;
Unlike languages like C,CPP.. we can use else for loops. When the loop condition of "for" or "while" statement fails then code part in "else" is executed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;count = 0
while count &amp;lt; 5:
    print(count)
    count += 1
else:
    print("The while loop completed without a break.")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fruits = ["apple", "banana", "cherry"]
for fruit in fruits:
    print(fruit)
else:
    print("The for loop completed without a break.")

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If a &lt;u&gt;break statement&lt;/u&gt; is executed inside the for loop then the "else" part is skipped. Note that the "else" part is executed even if there is a &lt;u&gt;continue statement&lt;/u&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;count = 0
while count &amp;lt; 5:
    print(count)
    count += 1
    if count == 3:
        break
else:
    print("This will not be printed because the loop was broken.")

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the else block is not executed because the while loop is terminated by a break statement when count is 3.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Range Function&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Syntax: range(start, stop, step)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Range() generates the integer numbers between a given start integer to a stop integer.&lt;/li&gt;
&lt;li&gt;A start integer is a starting number of the sequence. By default, it starts with 0 if not specified.&lt;/li&gt;
&lt;li&gt;A stop argument is an upper limit. Range() function generates numbers up to this number but not including this number.&lt;/li&gt;
&lt;li&gt;Start number is included but stop number is excluded.&lt;/li&gt;
&lt;li&gt;The step is a difference between each number in the result. The default value of the step is 1 if not specified.&lt;/li&gt;
&lt;li&gt;All the arguments (start, stop, step) must be integers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ex: range(1,6) =&amp;gt; [1,2,3,4,5] {it generates a sequence of integers from 1 to 5, but not 6}&lt;/p&gt;

&lt;p&gt;Note: print(range(1,6)) will not print any numbers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#printing 1 to 5
For num in range(1,6,1):
    Print(num,end=",")
&amp;gt;&amp;gt;1
2
3
4
5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#printing 5 to 1 backwards:
For num in range(1,6,-1):
    Print(num, end=",")
&amp;gt;&amp;gt;5
4
3
2
1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Nested Loop
&lt;/h3&gt;

&lt;p&gt;Nested Loop is a loop that is contained within another loop. The "inner loop" runs completely for each iteration of the "outer loop".&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rows=int(input())

for i in range(rows+1):#outer loop
  for j in range(i):#inner loop
    print(i,end=' ')
  print()
&amp;gt;&amp;gt;
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this, I will wrap up python loop. I hope this series on 'Loop' helped you to have a quick overview or brush up your knowledge about this topic. &lt;br&gt;
Here are 3 problems for you to solve on python loops. Solve these problems and share your solution in the comments. Happy coding!&lt;/p&gt;

&lt;h3&gt;
  
  
  Problems
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Write a Python program to check if the given string is a palindrome.(Palindrome is a word or sequence that reads the same forward and backward)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Write a Python program to check if the number is prime or not.(A prime number is a number which is only divisible by 1 and itself)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Display a Fibonacci sequence up to 10 terms. The Fibonacci Sequence is a series of numbers where the next number is found by adding up the two numbers before it. The first two numbers are 0 and 1.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Your task is to write a python program of a Fibonacci sequence of first 10 terms.&lt;br&gt;
(Output: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34)&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Python Basics 6: Loops part 1</title>
      <dc:creator>Irfan Faisal</dc:creator>
      <pubDate>Mon, 15 Jul 2024 22:20:04 +0000</pubDate>
      <link>https://forem.com/coderanger08/python-loops-1-5dho</link>
      <guid>https://forem.com/coderanger08/python-loops-1-5dho</guid>
      <description>&lt;p&gt;Hey everyone! I'm back with another new Python lesson for this week. This week we will study about loops. Loops are really important topic in any programming language. By understanding loops, you'll be able to perform tedious and long work in a matter of seconds. So you can realize how important loops are. So let's dive into it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why do we need loops?&lt;/strong&gt;&lt;br&gt;
Let's try to understand loop with a problem. Suppose, you're the class representative of your class and the professor has given you the responsibility of finding out the average grade in your class from the database. &lt;br&gt;
Now your class has 30 students. So there are 30 grades in the database. For now, let's assume, the grades are stored in a single variable as a list. (we'll talk more about "lists" later)&lt;br&gt;
Now it's surely going to take a long time to find out the average grade manually. So in this case, loops come into play. Loops will allow you to execute this tedious task in a small matter of time.&lt;/p&gt;

&lt;p&gt;So what is loop actually?&lt;/p&gt;

&lt;p&gt;A Python loop is a control structure that repeatedly executes a block of codes as long as a specified condition is met or for each item in a sequence.&lt;/p&gt;

&lt;p&gt;So in simple words, loop helps us to perform repeated tasks.&lt;/p&gt;

&lt;p&gt;Based on this definition, python loop is of two types.&lt;br&gt;
1) For loop&lt;br&gt;
2) While loop&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For Loop:&lt;/strong&gt;&lt;br&gt;
We use for loop to iterate over each elements in a sequence(string, list, tuple, dictionary, etc.) The loop will start from index 0 of the sequence and will run until the last item of that sequence.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for items in sequence:
    repetitive work or block of statements

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's solve the problem using for loop&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Here are our grades of 30 students
grades = [85, 92, 78, 88, 91, 76, 95, 89, 83, 77,
          90, 82, 84, 79, 87, 93, 81, 80, 86, 94,
          75, 88, 85, 92, 78, 89, 77, 84, 91, 76]


sum=0
for item in grades:
    sum=sum+item

average=sum/len(grades)

print(average)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;First, we have a variable named sum, where we'll store the sum of all grades. Then we have a for loop. The loop will start from index 0 item until the last item. In each iteration, it's going to add each item to the sum. Outside of this for loop's block, we will count the average by dividing the sum with no of grades(len function tells us how many items are in the list-more about this later).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;While loop&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In while loop, as long as the condition is true, the loop is going to iterate the block of codes. The moment, the condition is false, the loop is going to stop.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;while condition is true:
    do something repeatedly
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's solve the same problem using while loop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;grades = [85, 92, 78, 88, 91, 76, 95, 89, 83, 77,
          90, 82, 84, 79, 87, 93, 81, 80, 86, 94,
          75, 88, 85, 92, 78, 89, 77, 84, 91, 76]

sum = 0
index = 0

while index &amp;lt; len(grades):
    sum += grades[index]
    index += 1

average = sum / len(grades)

print(average)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: Here in this solution, you may notice some functions that we have not explained before. We'll talk more about those briefly in list lesson.&lt;/p&gt;

&lt;p&gt;So here in this solution, we've declared a new variable index alongside sum. Index variable help us to access the items of the grades list which gets incremented in each loop(index +=1). In while loop, the condition is as long as the index is less than the number of items in grades list, the loop will run and calculate the sum. grades[index] allow us access to the items of the list which is called indexing. The rest of the code is similar to for loop's solution.&lt;/p&gt;

&lt;p&gt;This will be the end of part 1 of Python loops. In the next part, we'll discuss more about loops.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Python loop is a structure that helps with repeated tasks&lt;/li&gt;
&lt;li&gt;For loop will iterate over each elements in a sequence(string,list,tuple,dictionary etc.)&lt;/li&gt;
&lt;li&gt;While loop will iterate as long as the condition is true.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Practice Problem&lt;/strong&gt;&lt;br&gt;
Here's a list of 20 numbers:&lt;br&gt;
num_list=[100, 82, 96, 4, 44, 27, 13, 45, 96, 21, 26, 71, 22, 19, 57, 69, 97, 34, 21, 92]&lt;/p&gt;

&lt;p&gt;Calculate the average of all the even numbers of the given list.&lt;/p&gt;

&lt;p&gt;Solve this problem for both For and While loop and share your answer in the comments. Happy Coding!&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>Python Basics 5: Conditionals</title>
      <dc:creator>Irfan Faisal</dc:creator>
      <pubDate>Fri, 28 Jun 2024 06:46:14 +0000</pubDate>
      <link>https://forem.com/coderanger08/python-conditionals-mje</link>
      <guid>https://forem.com/coderanger08/python-conditionals-mje</guid>
      <description>&lt;p&gt;Hey guys! Welcome again! Today we're gonna learn about conditionals. Python conditional is one of the core topics in learning python as a beginner and it is also really important for further topics. So understanding conditional is your top priority. With any further ado, let's get started.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is conditional
&lt;/h1&gt;

&lt;p&gt;First, let's imagine a real-world scenario. We all in our lives face any situation where we need to make a decision based on a condition. Like it's really common to say,&lt;br&gt;
"If it rains, we won't play".&lt;br&gt;
So you can see that here's the possibility of playing depending on if it rains or not. Here we're making a decision based on a condition.&lt;/p&gt;

&lt;p&gt;Similarly, in programming, sometimes we also need to execute a block of code based on a decision or a program will run if it satisfies a condition. Basically this concept is known as 'Conditionals'. Now let's dive into it!&lt;/p&gt;

&lt;p&gt;For conditionals, in python program, there are if, elif and else statements to perform this decision-making programs. We'll learn all of these one by one.&lt;/p&gt;

&lt;p&gt;We'll try to understand conditional through a simple project:&lt;/p&gt;

&lt;p&gt;Let's try to make a ticket system for a rollercoaster ride.&lt;/p&gt;

&lt;p&gt;We have the following conditions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If your height is over 120cm, you ride the rollercoaster.&lt;/li&gt;
&lt;li&gt;If your height is less than 120cm, you can't ride the rollercoaster.&lt;/li&gt;
&lt;li&gt;Your height is over 120cm but you're less than 12 years old, pay 4$&lt;/li&gt;
&lt;li&gt;Your height is over 120cm but you're less than 18 years old, pay 6$&lt;/li&gt;
&lt;li&gt;Your height is over 120cm but you're over 18 years old, pay 8$&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To implement this real-life scenario into code, we need decision-making features. For that we're going to use conditionals.&lt;/p&gt;

&lt;p&gt;Conditionals have if-else, if-elif-else statements. First, let's go over with the basic syntax of if-else.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If-else statement:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (condition):
    Block of codes
else:
    Block of codes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In 'if' statement it contains a condition and a block of codes.&lt;br&gt;
If the condition is true then our program will enter the body of 'if' statement and execute it. Otherwise if it is false, then it will go to the else statement and execute it.&lt;/p&gt;

&lt;p&gt;Here points to be noted, the colon after the condition is mendatory and the body of if statement had to follow indentation.&lt;br&gt;
Now we'll look at what indentation is.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;What is indentation?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In many cases, there are multiple lines of code under one condition.  The usual approach is to define a group of multiple statements into one compound statement or block.A block is regarded syntactically as a single entity. So whenever a condition is true this block will be executed otherwise not. &lt;/p&gt;

&lt;p&gt;To define a block there is a convention in python which is known as indentation. So basically indentation is the leading whitespace before a statement in python. Traditionally the amount of whitespace is four(you also can use tab button in the keybaord). The statements that have the same indentation level(same amount of whitespaces before them) are considered as a block of code in python.&lt;br&gt;
Whenever a statement breaks this indentation the block ends there.&lt;/p&gt;

&lt;p&gt;Let's implement if-else for our problem&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if height&amp;gt;=120:
    print("You can ride the rollercoaster")
else:
    print("you can't ride the rollercoaster")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;if-elif-else:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We have three more conditions to fulfill, right? We're going to use elif(else-if) statement to exmecute them.&lt;/p&gt;

&lt;p&gt;When your if condition is false and you want to add another condition, you can use elif statement.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (condition 1):
    Block of codes
elif (condition 2):
    Block of codes
else:
    Block of codes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;if condition 1 is true, it's going to execute the first block of codes. If it's false, then it will go to condition 2 of elif statement. If it's true then it will execute the second block of codes, otherwise it will go to else if it's false.&lt;br&gt;&lt;br&gt;
Point to be noted: the rest of the three conditions are dependent on whether the first condition is executed or not. That's why we're also going to use nested if statements. Nested means having other if statements under one if statement.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (condition 1):
    Block of codes
    if condition:
        Block of codes
    else:
        Block of codes
else:
    Block of codes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's implement all of these for our problem&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if height&amp;gt;=120:
    print("You can ride the rollercoaster")
    age=int(input("Enter your age:"))
    if age &amp;lt;= 12:
        print("Ticket price:4$")
    elif age &amp;lt;= 18:
        print("Ticket price:6$")
    else:
        print("Ticket price:$8")
else:
    print("you can't ride the rollercoaster")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There you go! I hope this blog helps you to understand conditionals. Now I have a problem for you to solve.&lt;/p&gt;

&lt;h3&gt;Practice problem&lt;/h3&gt;

&lt;p&gt;Write a program that interprets the Body Mass Index (BMI) based on a user's weight and height.&lt;br&gt;
BMI=weight(kg)/height**2(m)&lt;/p&gt;

&lt;p&gt;It should tell them the interpretation of their BMI based on the BMI value.&lt;/p&gt;

&lt;p&gt;Under 18.5 they are underweight&lt;br&gt;
Equal to or over 18.5 but below 25 they have a normal weight&lt;br&gt;
Equal to or over 25 but below 30 they are slightly overweight&lt;br&gt;
Equal to or over 30 but below 35 they are obese&lt;br&gt;
Equal to or over 35 they are clinically obese.&lt;/p&gt;

&lt;p&gt;Use input functions to take weight and height input from the user.&lt;br&gt;
Important: you do not need to round the result to the nearest whole number. It's fine to print out a floating point number for this exercise.&lt;/p&gt;

&lt;p&gt;Solve this problem and share your code in the comments.&lt;br&gt;
Happy coding!&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Python Basics 4: Input Function</title>
      <dc:creator>Irfan Faisal</dc:creator>
      <pubDate>Tue, 18 Jun 2024 21:36:36 +0000</pubDate>
      <link>https://forem.com/coderanger08/python-basics-4-input-function-5e94</link>
      <guid>https://forem.com/coderanger08/python-basics-4-input-function-5e94</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;em&gt;Input Function:&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
For taking input from the user directly, Python has a special built-in function, input(). It takes a string as a prompt argument, and it is optional. It is used to display information or messages to the user regarding the input.&lt;/p&gt;

&lt;p&gt;syntax: input("A prompt for the user")&lt;/p&gt;

&lt;p&gt;Suppose you're building a program where you need to know the name of the user. You can use the input function to do that. &lt;br&gt;
&lt;code&gt;name=input("What's your name?")&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Inside the input, we write the prompt, which will be displayed in the terminal to the user. Then user can write their input.&lt;/p&gt;

&lt;p&gt;input() pauses program execution to allow the user to type in a line of input from the keyboard. After typing, the user needs to press the ENTER key otherwise, the program will be waiting for the user's input indefinitely. &lt;/p&gt;

&lt;p&gt;Once the user presses the Enter key, all characters typed are read, stored in the variable (name), and returned as a &lt;strong&gt;string&lt;/strong&gt;.&lt;br&gt;
(remember this, we'll talk about type conversion briefly!)&lt;/p&gt;

&lt;p&gt;Now, let's suppose you also want to ask the user's age. As usual, you wrote your program like this:&lt;br&gt;
&lt;code&gt;age=input("Enter your age:")&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If your program is executed like this, at first glance, you won't see any problems with the code. However, the problem will arise when you want to do calculations with this age.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;age=input("Enter your age:")
print(age+10)

#TypeError: can only concatenate str (not "int") to str
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why did this error occur? So technically, your age variable never stored an integer in the first place.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;print(type(age)) #output: &amp;lt;class 'str'&amp;gt;&lt;/code&gt;&lt;br&gt;
As you can see your age variable has stored the input as a string. And you can't do calculations between string and integer.&lt;/p&gt;

&lt;p&gt;In order to solve the problem, you need to convert your string variable into integer. Which is called &lt;strong&gt;Type Conversion or Casting&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How can you do that?&lt;/strong&gt;&lt;br&gt;
 First, write down your datatype that you want to convert into. Then, use your input function to take input from the user. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;age=int(input("Enter your age"))&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This way, now your age variable will convert string into integer and store that. And now you can do calculations. &lt;/p&gt;

&lt;p&gt;More Examples: float()- to convert into float, str()=to convert into string etc.&lt;/p&gt;

&lt;p&gt;This type of type conversion is known as ;&lt;strong&gt;Explicit Casting&lt;/strong&gt;, which is done by us, the programmars.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Implicit Casting:&lt;/strong&gt; It is done by python. Here, python automatically changes between data types.&lt;/p&gt;

&lt;p&gt;Ex:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x=10(Integer)
x+=10.5
Print(x) &amp;gt;&amp;gt;&amp;gt; 20.5(Float)
Print(type(x)) &amp;gt;&amp;gt;&amp;gt; &amp;lt;class 'float'&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, python automatically changed integer into float .&lt;/p&gt;

&lt;p&gt;The input function is one of the most used functions in python. You can make your program more user-oriented by using input function.&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
