<?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>DEV Community: Nitin Reddy</title>
    <description>The latest articles on DEV Community by Nitin Reddy (@nitinreddy3).</description>
    <link>https://dev.to/nitinreddy3</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%2F116606%2F4406fa23-68a8-4d5a-a6e0-54ecb88e55d2.jpg</url>
      <title>DEV Community: Nitin Reddy</title>
      <link>https://dev.to/nitinreddy3</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nitinreddy3"/>
    <language>en</language>
    <item>
      <title>Wassup TypeScript Interfaces!</title>
      <dc:creator>Nitin Reddy</dc:creator>
      <pubDate>Sun, 22 Jan 2023 02:50:00 +0000</pubDate>
      <link>https://dev.to/nitinreddy3/wassup-typescript-interfaces-46bi</link>
      <guid>https://dev.to/nitinreddy3/wassup-typescript-interfaces-46bi</guid>
      <description>&lt;p&gt;TypeScript is a popular superset of JavaScript that adds optional static typing to the language. One of the key features of TypeScript is its support for interfaces, which allow you to define a contract for the shape of an object. This can be useful for defining the structure of objects that will be passed as function arguments, or for creating custom types that are used throughout your application.&lt;/p&gt;




&lt;p&gt;An interface in TypeScript is defined using the interface keyword, followed by the name of the interface. The interface definition includes a list of properties, along with their types. For example, the following interface defines a simple object with two properties, name and age, both of which are strings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;interface Person {
  name: string;
  age: string;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once an interface has been defined, it can be used to create variables and objects that conform to that specific shape. You can use the : operator to tell TypeScript that a variable or object should conform to a specific interface. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let person: Person = { name: "John Doe", age: "35" };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also use interfaces to define function types. This can be useful when a function takes an object as an argument, and you want to ensure that the object conforms to a specific shape. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;interface GreetingFunction {
  (person: Person): string;
}

let greet: GreetingFunction = (person: Person) =&amp;gt; {
  return "Hello, " + person.name;
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Interfaces can also be extended to create new interfaces that inherit the properties of existing interfaces. This can be useful for creating more specific interfaces that add additional properties or constraints to the base interface. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;interface Employee extends Person {
  salary: number;
}

let employee: Employee = { name: "Jane Doe", age: "28", salary: 50000 };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the Employee interface inherits all of the properties of the Person interface, but also includes an additional property, salary.&lt;/p&gt;

&lt;p&gt;In summary, interfaces in TypeScript are a powerful tool for defining the structure of objects and functions in your application. They allow you to create custom types that can be used throughout your code, and provide a way to ensure that objects conform to a specific shape. This can help to catch errors early on, reducing the chances of bugs and making your code more maintainable.&lt;/p&gt;




&lt;p&gt;Thanks in advance for reading this article...🚀&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I am more than happy to connect with you on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/_nitinreddy3" rel="noopener noreferrer"&gt;@twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/nitinreddy3/" rel="noopener noreferrer"&gt;@LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;You can also find me on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/nitinreddy3" rel="noopener noreferrer"&gt;@Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nitinreddy3"&gt;@DEV&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Let’s play around with Carousel marquee ✌️</title>
      <dc:creator>Nitin Reddy</dc:creator>
      <pubDate>Sat, 21 Jan 2023 02:09:57 +0000</pubDate>
      <link>https://dev.to/nitinreddy3/lets-play-around-with-carousel-marquee-15f1</link>
      <guid>https://dev.to/nitinreddy3/lets-play-around-with-carousel-marquee-15f1</guid>
      <description>&lt;p&gt;Today we will look at how we can create a carousel marquee view and customise it according to our requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  To experiment with the carousel view, we will
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Create a new &lt;a href="https://codesandbox.io/dashboard/recent" rel="noopener noreferrer"&gt;codesandbox&lt;/a&gt; project.&lt;/li&gt;
&lt;li&gt;Select a React boiler plate template&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;and boo-ya the project would be created for you.&lt;/p&gt;

&lt;p&gt;Now in the styles.css, update the code with the below CSS.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.App&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.wrapper&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;overflow-y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.marquee&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;white-space&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;nowrap&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;overflow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;hidden&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;inline-block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;marquee&lt;/span&gt; &lt;span class="m"&gt;50s&lt;/span&gt; &lt;span class="n"&gt;linear&lt;/span&gt; &lt;span class="n"&gt;infinite&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.marquee&lt;/span&gt; &lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;inline-block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.item&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;float&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;left&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;margin-right&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;margin-bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.item&lt;/span&gt;&lt;span class="nd"&gt;:last-child&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;margin-right&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;@keyframes&lt;/span&gt; &lt;span class="n"&gt;marquee&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;translate3d&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="err"&gt;100&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;translate3d&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;-100%&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&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;Update your App.js file with the below code,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;import "./styles.css";

export default function App() {
  const items = [
    {
      name: "Test1",
      url: "https://upload.wikimedia.org/wikipedia/commons/1/11/Test-Logo.svg"
    },
    {
      name: "Test2",
      url:
        "https://images.pling.com/img/00/00/48/70/84/1220648/e4fff450a6306e045f5c26801ce31c3efaeb.jpg"
    },
    {
      name: "Test3",
      url: "https://upload.wikimedia.org/wikipedia/commons/8/85/Logo-Test.png"
    },
    {
      name: "Test4",
      url:
        "https://static6.depositphotos.com/1014550/624/i/950/depositphotos_6240474-stock-photo-test-word-on-keyboard.jpg"
    },
    {
      name: "Test5",
      url: "https://upload.wikimedia.org/wikipedia/commons/1/11/Test-Logo.svg"
    },
    {
      name: "Test6",
      url:
        "https://images.pling.com/img/00/00/48/70/84/1220648/e4fff450a6306e045f5c26801ce31c3efaeb.jpg"
    },
    {
      name: "Test7",
      url: "https://upload.wikimedia.org/wikipedia/commons/8/85/Logo-Test.png"
    },
    {
      name: "Test8",
      url:
        "https://static6.depositphotos.com/1014550/624/i/950/depositphotos_6240474-stock-photo-test-word-on-keyboard.jpg"
    }
  ];
  return (
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;className=&lt;/span&gt;&lt;span class="s"&gt;"App"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Caoursel marquee&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;

      &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;className=&lt;/span&gt;&lt;span class="s"&gt;"wrapper"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;className=&lt;/span&gt;&lt;span class="s"&gt;"marquee"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
          {items.map(({ url, name }) =&amp;gt; {
            return (
              &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt;
                &lt;span class="na"&gt;className=&lt;/span&gt;&lt;span class="s"&gt;"item"&lt;/span&gt;
                &lt;span class="na"&gt;onClick=&lt;/span&gt;&lt;span class="s"&gt;{()&lt;/span&gt; &lt;span class="err"&gt;=&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; window.open(url, "_blank")}
              &amp;gt;
                &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;{url}&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"100"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"100"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;{name}/&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
              &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
            );
          })}
        &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So easy, right? You can find the &lt;a href="https://codesandbox.io/s/carousel-delay-l5yqzi?" rel="noopener noreferrer"&gt;project&lt;/a&gt; on &lt;a href="https://codesandbox.io/" rel="noopener noreferrer"&gt;codesandbox&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Credits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/questions/45847392/pure-css-continuous-horizontal-text-scroll-without-break" rel="noopener noreferrer"&gt;https://stackoverflow.com/questions/45847392/pure-css-continuous-horizontal-text-scroll-without-break&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks in advance for reading this article...🚀&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I am more than happy to connect with you on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/_nitinreddy3" rel="noopener noreferrer"&gt;@twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/nitinreddy3/" rel="noopener noreferrer"&gt;@LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;You can also find me on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/nitinreddy3" rel="noopener noreferrer"&gt;@Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nitinreddy3"&gt;@DEV&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>discuss</category>
      <category>productivity</category>
      <category>career</category>
    </item>
    <item>
      <title>Configure Jest and usage in UmiJS 🥳</title>
      <dc:creator>Nitin Reddy</dc:creator>
      <pubDate>Thu, 12 Jan 2023 12:54:37 +0000</pubDate>
      <link>https://dev.to/nitinreddy3/configure-jest-and-usage-in-umijs-34ph</link>
      <guid>https://dev.to/nitinreddy3/configure-jest-and-usage-in-umijs-34ph</guid>
      <description>&lt;p&gt;Before setting up Jest and using it in your application,&lt;br&gt;
you can initiate a umijs project using the following&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn create @umijs/umi-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  To configure Jest in umi.js, you will need to install the following dependencies:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://jestjs.io/" rel="noopener noreferrer"&gt;jest&lt;/a&gt; and &lt;a href="https://testing-library.com/docs/react-testing-library/intro/" rel="noopener noreferrer"&gt;@testing-library/react&lt;/a&gt;: These are the core libraries needed for running tests and testing React components.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.npmjs.com/package/babel-jest" rel="noopener noreferrer"&gt;babel-jest&lt;/a&gt;: This library is needed to enable Jest to understand modern JavaScript syntax.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;@umijs/preset-jest: This is a preset that provides a set of Jest configurations that are optimized for umi.js.&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%2Fb30nnei7fgigjtjijg64.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%2Fb30nnei7fgigjtjijg64.png" alt="Image description" width="512" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you have installed these dependencies, you can add a jest field to the package.json file in your project's root directory. This field should contain the following configurations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "jest": {
    "preset": "@umijs/preset-jest"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You also need to add jest script in package.json&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"scripts": {
    "test": "jest"
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And then you can run the test cases via npm run test&lt;/p&gt;

&lt;p&gt;You can also configure Jest with a configuration file, &lt;code&gt;jest.config.js&lt;/code&gt;, in the project's root directory. This file should export an object that contains the Jest configurations.&lt;/p&gt;

&lt;p&gt;Make sure you have the correct imports and presets in your &lt;code&gt;jest.config.js&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const { presets } = require('@umijs/preset-jest');
module.exports = {
  ...presets,
  testMatch: ['&amp;lt;rootDir&amp;gt;/tests/**/*.test.js'],
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should get you started with Jest in umi.js.&lt;/p&gt;

&lt;h2&gt;
  
  
  To write unit tests in umi.js, you can use Jest as the test runner and React testing library as the testing library.
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Create a &lt;strong&gt;tests&lt;/strong&gt; folder in your project, and create a test file for the component you want to test (e.g. MyComponent.test.js).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Import the component you want to test and the Enzyme library at the top of the test file:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';
import { render } from '@testing-library/react';
import MyComponent from './MyComponent';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Write your test cases using Jest and Enzyme. For example, you can test if the component renders correctly by doing the following:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;describe('MyComponent', () =&amp;gt; {
  it('should render the component', () =&amp;gt; {
    const { getByText } = render(&amp;lt;MyComponent /&amp;gt;);
    const text = getByText(/Hello, World!/i);
    expect(text).toBeInTheDocument();
  });
});

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Finally, you can run the tests by running the following command:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx jest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure you have the jest configuration file in your project root directory. If not, you can create one with the command &lt;code&gt;jest --init&lt;/code&gt; or creating a file called jest.config.js in the root of your project with the following content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module.exports = {
  "setupFilesAfterEnv": ["&amp;lt;rootDir&amp;gt;/setupTests.js"]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thanks in advance for reading this article...🚀&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I am more than happy to connect with you on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/_nitinreddy3" rel="noopener noreferrer"&gt;@twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/nitinreddy3/" rel="noopener noreferrer"&gt;@LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;You can also find me on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/nitinreddy3" rel="noopener noreferrer"&gt;@Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nitinreddy3"&gt;@DEV&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@nitinreddy3" rel="noopener noreferrer"&gt;@Medium&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>monitoring</category>
      <category>learning</category>
    </item>
    <item>
      <title>Python Dictionaries - Update data, loop through 🐍</title>
      <dc:creator>Nitin Reddy</dc:creator>
      <pubDate>Wed, 04 Jan 2023 17:07:29 +0000</pubDate>
      <link>https://dev.to/nitinreddy3/python-dictionaries-part-3-haj</link>
      <guid>https://dev.to/nitinreddy3/python-dictionaries-part-3-haj</guid>
      <description>&lt;p&gt;Dictionaries are an interesting data structure in Python. In other programming languages like JavaScript, you can call it an object.&lt;/p&gt;

&lt;p&gt;Getting back to our example, we can change the value of a dictionary key as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dict = {"name": "Nitin", "age": 34, "gender": "male"}

dict["name"] = "ABC"
dict["name"]
Result -&amp;gt; ABC
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pretty easy isn't it?&lt;/p&gt;

&lt;h3&gt;
  
  
  Add a new key-value pair
&lt;/h3&gt;

&lt;p&gt;Now let's look at how we can add a new key-value pair to a dictionary.&lt;br&gt;
Python dictionary has an &lt;code&gt;update&lt;/code&gt; method that gives you the freedom to add or update a new key-value pair.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dict = {"name": "Nitin", "age": 34, "gender": "male"}

dict.update({"city": "Pune"})
dict
Result -&amp;gt; {"name": "Nitin", "age": 34, "gender": "male", "city": "Pune"}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Update a key-value pair
&lt;/h3&gt;

&lt;p&gt;Updating a key-value pair is pretty simple.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dict = {"name": "Nitin", "age": 34, "gender": "male"}

dict.update({"city": "Delhi"})
dict
Result -&amp;gt; {"name": "Nitin", "age": 34, "gender": "male", "city": "Delhi"}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you observe in the above example, the new key-value pair is added with the curly braces as an argument to the &lt;code&gt;update&lt;/code&gt; method.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If the key-value pair already exists in the dictionary then the value will be replaced and if the key-value pair does not exist then this method will create a new key-value pair.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Loop over the dictionary
&lt;/h3&gt;

&lt;p&gt;We can also loop over the dictionary data using the &lt;code&gt;for&lt;/code&gt; iterator and it's quite easy.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dict = {"name": "Nitin", "age": 34, "gender": "male"}

for data in dict.keys():
    print(data)

Result -&amp;gt;
name
age
gender
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we loop over the dictionary keys and as a result, the keys are getting printed.&lt;/p&gt;

&lt;p&gt;We can also loop over the dictionary keys' values using the &lt;code&gt;for&lt;/code&gt; iterator&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dict = {"name": "Nitin", "age": 34, "gender": "male"}

for data in dict.values():
    print(data)

Result -&amp;gt;
Nitin
34
male
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Easy to understand? 💡
&lt;/h3&gt;

&lt;p&gt;A dictionary contains&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Loop over the dictionary&lt;/li&gt;
&lt;li&gt;Add or update the dictionary data&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;This would look similar to an object in JavaScript&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Conclusion 📗
&lt;/h2&gt;

&lt;p&gt;There are more posts on the way related to the dictionaries...So keep reading.&lt;/p&gt;

&lt;p&gt;Thanks in advance for reading this article...🚀&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I am more than happy to connect with you on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/_nitinreddy3" rel="noopener noreferrer"&gt;@twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/nitinreddy3/" rel="noopener noreferrer"&gt;@LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;You can also find me on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/nitinreddy3" rel="noopener noreferrer"&gt;@Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nitinreddy3"&gt;@DEV&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@nitinreddy3" rel="noopener noreferrer"&gt;@Medium&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>unity3d</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>Python Dictionaries - Access, delete element…</title>
      <dc:creator>Nitin Reddy</dc:creator>
      <pubDate>Mon, 02 Jan 2023 10:50:11 +0000</pubDate>
      <link>https://dev.to/nitinreddy3/python-dictionaries-part-2-2keo</link>
      <guid>https://dev.to/nitinreddy3/python-dictionaries-part-2-2keo</guid>
      <description>&lt;p&gt;In the &lt;a href="https://dev.to/nitinreddy3/learn-python-9-yeah-dictionary-4lac"&gt;last&lt;/a&gt; article we had seen how we can create a dictionary and access an element in it. Today we are going to deep dive into the main data structure in Python known as Dictionary.&lt;/p&gt;

&lt;h2&gt;
  
  
  Accessing an element 💡
&lt;/h2&gt;

&lt;p&gt;The element in the dictionary can be accessed through the square brackets nomenclature.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dict = {"name": "Nitin", "age": 34, "gender": "male"}

dict["name"]
Result -&amp;gt; Nitin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What if you are trying to access an element that is not in the dictionary?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dict = {"name": "Nitin", "age": 34, "gender": "male"}

dict["address"]
Result -&amp;gt; Traceback (most recent call last):
  File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;
KeyError: 'address'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above example, the address is not in the dictionary because we are trying to access it from the square brackets.&lt;/p&gt;

&lt;p&gt;But we can also leverage the &lt;code&gt;get&lt;/code&gt; method to access the dictionary key&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dict = {"name": "Nitin", "age": 34, "gender": "male"}
dict.get("name")
Result -&amp;gt; 'Nitin'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Delete an element with &lt;code&gt;del&lt;/code&gt; method 💡
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dict = {"name": "Nitin", "age": 34, "gender": "male"}
del(dict["name"])
print(dict)
Result -&amp;gt; {"age": 34, "gender": "male"}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Delete the dictionary 💡
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dict = {"name": "Nitin", "age": 34, "gender": "male"}
del(dict)
print(dict)
Result -&amp;gt; &amp;lt;class 'dict'&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In order to delete the dictionary you just have to mention the dictionary variable name in the &lt;code&gt;del&lt;/code&gt; method.&lt;/p&gt;

&lt;h3&gt;
  
  
  Find the length 💡
&lt;/h3&gt;

&lt;p&gt;Finding the length of the dictionary is quite simple.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dict = {"name": "Nitin", "age": 34, "gender": "male"}
len(dict)
Result -&amp;gt; 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Check if the key exists 💡
&lt;/h3&gt;

&lt;p&gt;Not so difficult.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dict = {"name": "Nitin", "age": 34, "gender": "male"}
print("name" in dict)
Result -&amp;gt; True
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The boolean would be returned when you try to check the key in the dictionary.&lt;/p&gt;

&lt;h3&gt;
  
  
  Easy to understand? 💡
&lt;/h3&gt;

&lt;p&gt;A dictionary contains&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;unique keys&lt;/li&gt;
&lt;li&gt;key can have different types of values like &lt;code&gt;number&lt;/code&gt;, &lt;code&gt;string&lt;/code&gt;, &lt;code&gt;boolean&lt;/code&gt; etc.&lt;/li&gt;
&lt;li&gt;we can access dictionary elements with multiple approaches&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;This would look similar to an object in JavaScript&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Conclusion 📗
&lt;/h2&gt;

&lt;p&gt;There are more posts on the way related to the tuples...So keep reading.&lt;/p&gt;

&lt;p&gt;Thanks in advance for reading this article...🚀&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I am more than happy to connect with you on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/_nitinreddy3" rel="noopener noreferrer"&gt;@twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/nitinreddy3/" rel="noopener noreferrer"&gt;@LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;You can also find me on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/nitinreddy3" rel="noopener noreferrer"&gt;@Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nitinreddy3"&gt;@DEV&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@nitinreddy3" rel="noopener noreferrer"&gt;@Medium&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>python</category>
      <category>programming</category>
      <category>learning</category>
    </item>
    <item>
      <title>Let us learn about UmiJS</title>
      <dc:creator>Nitin Reddy</dc:creator>
      <pubDate>Wed, 26 Oct 2022 05:45:09 +0000</pubDate>
      <link>https://dev.to/nitinreddy3/let-us-learn-about-umijs-468n</link>
      <guid>https://dev.to/nitinreddy3/let-us-learn-about-umijs-468n</guid>
      <description>&lt;h2&gt;
  
  
  What is &lt;a href="https://v3.umijs.org/" rel="noopener noreferrer"&gt;UmiJS&lt;/a&gt; 💡
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;It leverages the idealogy of React, NextJS and TypeScript.&lt;/li&gt;
&lt;li&gt;It is a utility framework that can be used to build enterprise-level applications.&lt;/li&gt;
&lt;li&gt;Built by Ant Group, the subsidiary of Alibaba.&lt;/li&gt;
&lt;li&gt;It has an in-built routing mechanism that supports configuration and conventional routing.&lt;/li&gt;
&lt;li&gt;Supports micro-frontend, component packaging, documentation tools, request library, hooks library, data flow etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setup the project
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;node ≥ 10.13.0&lt;/li&gt;
&lt;li&gt;yarn package&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Create an empty project
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;$ mkdir myapp &amp;amp;&amp;amp; cd myapp&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Create a umi project
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;$ yarn create @umijs/umi-app&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media.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%2F95s45589u0eqausaol5f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F95s45589u0eqausaol5f.png" alt="mkdir" width="673" height="541"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Install dependencies
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;$ yarn&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media.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%2F4he9f2zrav6zymloolzb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F4he9f2zrav6zymloolzb.png" alt="dependencyinstall" width="800" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Start the project
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;$ yarn start&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media.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%2Fs1tvr0o7v9uc4r3aclqs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fs1tvr0o7v9uc4r3aclqs.png" alt="startapp" width="738" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Check the application running
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fis6krmu8kpiziheioni0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fis6krmu8kpiziheioni0.png" alt="startup" width="800" height="470"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Folder structure
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;.umi&lt;/code&gt; folder contains the umi plugins that would be used across the development of the application.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pages&lt;/code&gt; folder contains the files that would be rendered in the UI. The name of the file name is the route name for the file as well.
&lt;img src="https://media.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%2Fm14zmn4h71dv57sffm7a.png" alt="folderstructure" width="235" height="707"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion 📗
&lt;/h2&gt;

&lt;p&gt;More details are incoming around UmiJS...&lt;/p&gt;

&lt;p&gt;Thanks in advance for reading this article...🚀&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I am more than happy to connect with you on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/_nitinreddy3" rel="noopener noreferrer"&gt;@twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/nitinreddy3/" rel="noopener noreferrer"&gt;@LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;You can also find me on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/nitinreddy3" rel="noopener noreferrer"&gt;@Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nitinreddy3"&gt;@DEV&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@nitinreddy3" rel="noopener noreferrer"&gt;@Medium&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>umijs</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Learn Python #9 - Yeah Dictionary🐍</title>
      <dc:creator>Nitin Reddy</dc:creator>
      <pubDate>Fri, 07 Oct 2022 11:33:12 +0000</pubDate>
      <link>https://dev.to/nitinreddy3/learn-python-9-yeah-dictionary-4lac</link>
      <guid>https://dev.to/nitinreddy3/learn-python-9-yeah-dictionary-4lac</guid>
      <description>&lt;p&gt;Today we are going to deep dive into the main data structure in Python known as Dictionary.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Not a dictionary of words&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What is Dictionary?💡
&lt;/h2&gt;

&lt;p&gt;In Python, a dictionary is a list of key-value pairs.&lt;br&gt;
Ok, let's take an example.&lt;/p&gt;
&lt;h3&gt;
  
  
  Creating a Dictionary💡
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dictionary_1 = {
  'name': 'Nitin',
  'age': 34,
  'country': 'India'
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In the above example&lt;br&gt;
&lt;code&gt;name&lt;/code&gt;, &lt;code&gt;age&lt;/code&gt;, and &lt;code&gt;country&lt;/code&gt; are the keys with the corresponding values as &lt;code&gt;Nitin&lt;/code&gt;, 34, and &lt;code&gt;India&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Also, we can create a nested dictionary&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dictionary_1 = {
  'name': 'Nitin',
  'age': 34,
  'address': {
    'street': 'Keshav'
    'country': 'India'
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Easy to understand?💡
&lt;/h3&gt;

&lt;p&gt;A dictionary contains&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;unique keys&lt;/li&gt;
&lt;li&gt;key can have different types of values like &lt;code&gt;number&lt;/code&gt;, &lt;code&gt;string&lt;/code&gt;, &lt;code&gt;boolean&lt;/code&gt; etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;This would look similar to an object in JavaScript&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Accessing a key's value💡
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dictionary_1 = {
  'name': 'Nitin',
  'age': 34,
  'country': 'India'
}

dictionary_1['name']
// Nitin


dictionary_2 = {
  'name': 'Nitin',
  'age': 34,
  'address': {
    'street': 'Keshav'
    'country': 'India'
  }
}

dictionary_2['address']['street']
// Keshav
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To access any value in a dictionary, we need to enclose the &lt;code&gt;key&lt;/code&gt; in square brackets &lt;code&gt;[]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F90k17yodt8z9s7n2l9rq.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F90k17yodt8z9s7n2l9rq.jpg" alt="think" width="514" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion 📗
&lt;/h2&gt;

&lt;p&gt;There are more posts on the way related to the tuples...So keep reading.&lt;/p&gt;

&lt;p&gt;Thanks in advance for reading this article...🚀&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I am more than happy to connect with you on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/_nitinreddy3" rel="noopener noreferrer"&gt;@twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/nitinreddy3/" rel="noopener noreferrer"&gt;@LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;You can also find me on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/nitinreddy3" rel="noopener noreferrer"&gt;@Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nitinreddy3"&gt;@DEV&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@nitinreddy3" rel="noopener noreferrer"&gt;@Medium&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>programming</category>
      <category>web</category>
      <category>webdev</category>
      <category>python</category>
    </item>
    <item>
      <title>Learn Python #8 - Let's do Tuple...🐍</title>
      <dc:creator>Nitin Reddy</dc:creator>
      <pubDate>Sat, 10 Sep 2022 08:34:42 +0000</pubDate>
      <link>https://dev.to/nitinreddy3/lets-do-tuple-ckh</link>
      <guid>https://dev.to/nitinreddy3/lets-do-tuple-ckh</guid>
      <description>&lt;h2&gt;
  
  
  Tuples 💡
&lt;/h2&gt;

&lt;p&gt;Tuple in Python is a collection that is ordered, and unchangeable.&lt;/p&gt;

&lt;h3&gt;
  
  
  Find an element by index 💡
&lt;/h3&gt;

&lt;p&gt;You can find an element in the &lt;code&gt;tuple&lt;/code&gt; by index&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;new_tuple=(1,"b",False)
print(new_tuple[0]) //1
print(new_tuple[1]) //"b"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Ordered 💡
&lt;/h3&gt;

&lt;p&gt;The tuple is an ordered collection. The order can not be changed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Unchangeable 💡
&lt;/h3&gt;

&lt;p&gt;Once defined, the &lt;code&gt;tuple&lt;/code&gt; cannot be changed. But we can do some work around to update the &lt;code&gt;tuple&lt;/code&gt; by leveraging &lt;code&gt;list&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;new_tuple = (1,"b")
updated_tuple = list(new_tuple)
updated_tuple[1] = "c"
new_tuple = tuple(updated_tuple)
print(new_tuple) // (1,"c")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Access the elements 💡
&lt;/h3&gt;

&lt;p&gt;Items in a tuple can be accessed with a negative index as well.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;new_tuple=(1,2,3,"a", False)
new_tuple[-1] //False
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion 📗
&lt;/h2&gt;

&lt;p&gt;There are more posts on the way related to the tuples...So keep reading.&lt;/p&gt;

&lt;p&gt;Thanks in advance for reading this article...🚀&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I am more than happy to connect with you on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/_nitinreddy3" rel="noopener noreferrer"&gt;@twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/nitinreddy3/" rel="noopener noreferrer"&gt;@LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;You can also find me on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/nitinreddy3" rel="noopener noreferrer"&gt;@Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nitinreddy3"&gt;@DEV&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@nitinreddy3" rel="noopener noreferrer"&gt;@Medium&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>webdev</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Learn Python #7 - List operations 💡!</title>
      <dc:creator>Nitin Reddy</dc:creator>
      <pubDate>Sat, 03 Sep 2022 01:06:33 +0000</pubDate>
      <link>https://dev.to/nitinreddy3/list-operations--456a</link>
      <guid>https://dev.to/nitinreddy3/list-operations--456a</guid>
      <description>&lt;p&gt;💡This is a continuation of what we had learnt in our last &lt;a href="https://dev.to/nitinreddy3/learn-python-6-lets-list-it-36ok"&gt;post&lt;/a&gt;. Let us learn more about some other operations that could be performed on the python lists.&lt;/p&gt;

&lt;p&gt;📘So today we will be covering the following list of operations:-&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Combining list&lt;/li&gt;
&lt;li&gt;Removing list items&lt;/li&gt;
&lt;li&gt;Clearing out a list&lt;/li&gt;
&lt;li&gt;Counting how many times an item appeared in the list&lt;/li&gt;
&lt;li&gt;Finding a list item's index&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Combining list
&lt;/h3&gt;

&lt;p&gt;In python, combining the two lists is bit easy. Let's learn through an example...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;list1 = ['Roger', 'Stark', 'Banner'] //List 1
list2 = ['Steve', 'Tony', 'Bruce'] //List 2

list1.extend(list2)
//['Roger', 'Stark', 'Banner', 'Steve', 'Tony', 'Bruce']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above example, list1 is extended by including the list items of list2.&lt;/p&gt;

&lt;h3&gt;
  
  
  Removing list items
&lt;/h3&gt;

&lt;p&gt;There are different ways in which the item can be removed from the list. Let's look at them one by one&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;remove&lt;/code&gt; method
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;list1 = ['Roger', 'Stark', 'Banner']
list1.remove('Roger')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;pop&lt;/code&gt; method
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;list1 = ['Roger', 'Stark', 'Banner', 'Steve', 'Tony', 'Bruce']
list1.pop(0) // 'Roger' is removed from the list since the index specified is 0
// Result - ['Stark', 'Banner', 'Steve', 'Tony', 'Bruce']

list1.pop() // 'Bruce' is removed from the list as it was the last item on the list.
// Result - ['Stark', 'Banner', 'Steve', 'Tony']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;del&lt;/code&gt; keyword
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;list1 =  ['Roger', 'Stark', 'Banner', 'Steve', 'Tony', 'Bruce']
del list1[2]
// Result -  ['Roger', 'Stark', 'Steve', 'Tony', 'Bruce']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Clearing out the list
&lt;/h3&gt;

&lt;p&gt;In case you want the delete the content of the lists but not the list, you can use the &lt;code&gt;clear&lt;/code&gt; method on the list.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;list1 =  ['Roger', 'Stark', 'Banner', 'Steve', 'Tony', 'Bruce']
list1.clear()
// Result - []
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Easy peasy isn't it?&lt;/p&gt;

&lt;h3&gt;
  
  
  Counting how many times an item appeared in the list
&lt;/h3&gt;

&lt;p&gt;You can also find the number of appearances of a specific item in a list. This can be achieved by using the &lt;code&gt;count&lt;/code&gt; method on a list that takes an item as an argument.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;list1 =  ['Roger', 'Stark', 'Banner', 'Roger', 'Tony', 'Bruce']
list1.count('Roger')
// Result - 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Finding a list item's index
&lt;/h3&gt;

&lt;p&gt;This operation would be pretty useful when you want to find and replace an item in the list with another item.&lt;br&gt;
To find an index of an item in a list, we use the &lt;code&gt;index&lt;/code&gt; method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;list1 =  ['Roger', 'Stark', 'Banner', 'Roger', 'Tony', 'Bruce']
list1.index('Roger')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The catch here is that this method will return the index of the first instance of an item from the list.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;There are more posts on the way related to the lists...So keep reading.&lt;/p&gt;

&lt;p&gt;Thanks in advance for reading this article...🚀&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I am more than happy to connect with you on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/_nitinreddy3" rel="noopener noreferrer"&gt;@twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/nitinreddy3/" rel="noopener noreferrer"&gt;@LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;You can also find me on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/nitinreddy3" rel="noopener noreferrer"&gt;@Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nitinreddy3"&gt;@DEV&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@nitinreddy3" rel="noopener noreferrer"&gt;@Medium&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>build</category>
    </item>
    <item>
      <title>Deep cloning of an object in JavaScript...</title>
      <dc:creator>Nitin Reddy</dc:creator>
      <pubDate>Tue, 16 Aug 2022 19:00:00 +0000</pubDate>
      <link>https://dev.to/nitinreddy3/deep-cloning-of-an-object-in-javascript-480k</link>
      <guid>https://dev.to/nitinreddy3/deep-cloning-of-an-object-in-javascript-480k</guid>
      <description>&lt;p&gt;As JavaScript developers, we most often than not come across a situation where we want to clone an object and reuse it to perform some operations.&lt;/p&gt;

&lt;p&gt;And we usually follow well-known approaches to deep clone the object:-&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;lodash's cloneDeep method&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;JSON.parse(JSON.stringify(object))&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What if I say that you are not supposed to use the above two approaches and you should create your custom method to deep clone the object?&lt;/p&gt;

&lt;p&gt;I have an answer for that. Let's write a utility method that would help us in achieving the deep cloning of an object.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;

&lt;p&gt;Let us say that I have a nested object as below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let emptyStack = {
  feTools: 'JS, React, NextJS, Tailwindcss, Netlify',
  react: {
    baseConcepts: 'props, states, hooks',
    advancedConcepts: {
      hoc: 'composition of the functions',
      contextApi: 'Sharing the data without prop drilling'
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So in the above, as you can see we have the nested objects inside &lt;code&gt;emptyStack&lt;/code&gt;. Let us try to understand and evaluate what all steps are required to be executed to achieve the deep cloning of an object.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pseudo code
&lt;/h2&gt;

&lt;p&gt;Steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Initialize a new empty object&lt;/li&gt;
&lt;li&gt;Iterate over the keys of an object and check if the key-value pair is an object&lt;/li&gt;
&lt;li&gt;And based on the result of Step#2 update the empty object with the new properties.&lt;/li&gt;
&lt;li&gt;Repeat the Step#2 and #3 till the last element of an object is evaluated.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The ultimate utility method
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function deepCopy(currentObj) {
  let newObj = Array.isArray(currentObj) ? [] : {}; //Step#1
  for (let key in currentObj) { //Step#2
    let property = currentObj[key];
    if (typeof property === "object") {
      newObj[key] = deepCopy(property); //Step#3
    } else {
      newObj[key] = property; //Step#3
    }
  }
  return newObj;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let deepClonedObject = deepCopy(emptyStack)

console.log(`${JSON.stringify(deepClonedObject)}`)
/** Output
{"feTools":"JS, React, NextJS, Tailwindcss, Netlify","react":{"baseConcepts":"props, states, hooks","advancedConcepts":{"hoc":"composition of the functions","contextApi":"Sharing the data without prop drilling"}}} */
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What all concepts are used in the above method?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Recursive function&lt;/li&gt;
&lt;li&gt;Object keys iteration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2Ftumwsya4lp2a77f7gy1h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Ftumwsya4lp2a77f7gy1h.png" alt="Recursive function" width="337" height="149"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Deep cloning an object is really useful in the scenarios where you want the back referencing to happen for a cloned object.&lt;br&gt;
There are more posts on the way related to the lists...So keep reading.&lt;/p&gt;

&lt;p&gt;Thanks in advance for reading this article...🚀&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I am more than happy to connect with you on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/_nitinreddy3" rel="noopener noreferrer"&gt;@twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/nitinreddy3/" rel="noopener noreferrer"&gt;@LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;You can also find me on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/nitinreddy3" rel="noopener noreferrer"&gt;@Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nitinreddy3"&gt;@DEV&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@nitinreddy3" rel="noopener noreferrer"&gt;@Medium&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>learn</category>
    </item>
    <item>
      <title>Learn Python #6 - Let's List it...</title>
      <dc:creator>Nitin Reddy</dc:creator>
      <pubDate>Sun, 07 Aug 2022 01:02:00 +0000</pubDate>
      <link>https://dev.to/nitinreddy3/learn-python-6-lets-list-it-36ok</link>
      <guid>https://dev.to/nitinreddy3/learn-python-6-lets-list-it-36ok</guid>
      <description>&lt;h2&gt;
  
  
  What are Lists?
&lt;/h2&gt;

&lt;p&gt;Lists in Python are the collection of elements of data. What does that mean? Let's check the below examples.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fwiowauriesm0jnta7x00.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fwiowauriesm0jnta7x00.jpg" alt="List" width="253" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Let us look at an example
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Example 1:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's say we have a list of employees with their &lt;code&gt;name&lt;/code&gt; as the list items&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;employees = ["Abc", "Bcd"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above item, you can add a new item, remove an item, append an item, and furthermore.&lt;/p&gt;

&lt;h3&gt;
  
  
  Add an item
&lt;/h3&gt;

&lt;p&gt;There are two ways in which we can add a new item to the list.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Append
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;employee.append("Cde")
// employee -&amp;gt; ["Abc", "Bcd", "Cde"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Insert
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;employee.insert(0, "Efg")
// employee -&amp;gt; ["Efg", "Abc", "Bcd", "Cde"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The difference between the &lt;code&gt;append&lt;/code&gt; and &lt;code&gt;insert&lt;/code&gt; methods is that the &lt;code&gt;append&lt;/code&gt; add the element at the last position of the list whereas in &lt;code&gt;insert&lt;/code&gt; you can specify at what position you want to add the element.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Get the length of the list
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;employee = ["Efg", "Abc", "Bcd", "Cde"]
len(employee) -&amp;gt; 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;len&lt;/code&gt; is useful that helps in getting the length of a list.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reference a list item by its position
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;employee = ["Efg", "Abc", "Bcd", "Cde"]
employee[2]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the &lt;code&gt;[]&lt;/code&gt; you need to specify a position of an element that you need a reference to.&lt;/p&gt;

&lt;h3&gt;
  
  
  Changing an item in the list
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;employee = ["Efg", "Abc", "Bcd", "Cde"]
employee[1] = "Nitin"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Find the element by specifying the position and then assign the value.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;There are more posts on the way related to the lists...So keep reading.&lt;/p&gt;

&lt;p&gt;Thanks in advance for reading this article...🚀&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I am more than happy to connect with you on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/_nitinreddy3" rel="noopener noreferrer"&gt;@twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/nitinreddy3/" rel="noopener noreferrer"&gt;@LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;You can also find me on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/nitinreddy3" rel="noopener noreferrer"&gt;@Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nitinreddy3"&gt;@DEV&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@nitinreddy3" rel="noopener noreferrer"&gt;@Medium&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>programming</category>
      <category>python</category>
      <category>webdev</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Let’s do fabform…</title>
      <dc:creator>Nitin Reddy</dc:creator>
      <pubDate>Thu, 28 Jul 2022 04:47:09 +0000</pubDate>
      <link>https://dev.to/nitinreddy3/lets-do-fabform-51bo</link>
      <guid>https://dev.to/nitinreddy3/lets-do-fabform-51bo</guid>
      <description>&lt;h2&gt;
  
  
  What is fabform?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://fabform.io/" rel="noopener noreferrer"&gt;Fabform&lt;/a&gt; is a smart form endpoint for developers who are using the forms in the web apps on a day-to-day basis.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://fabform.io/" rel="noopener noreferrer"&gt;Fabform&lt;/a&gt; provides an endpoint to play around with their neat APIs.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to create the fabform API id?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Signup to fabform.io&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fqqp7ec3jc2cipt0m7gjl.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fqqp7ec3jc2cipt0m7gjl.PNG" alt="form1" width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click on &lt;code&gt;Create endpoint&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fs30hohl76lbduue4694j.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fs30hohl76lbduue4694j.PNG" alt="form2" width="800" height="345"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Provide a meaningful name to create an endpoint.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.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%2F1i38fv9a492jhqx2y51n.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F1i38fv9a492jhqx2y51n.PNG" alt="form3" width="800" height="446"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And that is it. You are done&lt;/p&gt;

&lt;h2&gt;
  
  
  How to play around with the fabform API?
&lt;/h2&gt;

&lt;p&gt;Once you create an endpoint, you can simply click on &lt;code&gt;Test Form&lt;/code&gt; to try the API.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fmysnwu49ozzjoi533lty.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fmysnwu49ozzjoi533lty.PNG" alt="form4" width="800" height="329"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will see the input boxes asking for &lt;code&gt;First Name&lt;/code&gt;, &lt;code&gt;Last Name&lt;/code&gt; and &lt;code&gt;Email&lt;/code&gt; to be entered. Once you enter the fields click on the &lt;code&gt;Test Form&lt;/code&gt; button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Ffkg7rpfcipo8k7evvrey.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Ffkg7rpfcipo8k7evvrey.PNG" alt="form5" width="800" height="489"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you click on the &lt;code&gt;Test Form&lt;/code&gt; button, information is saved corresponding to the API ID that you had created earlier.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fcfmmexswb1ym1hv6znz3.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fcfmmexswb1ym1hv6znz3.PNG" alt="form6" width="800" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Try this new tool to save the form data via their API. It’s easy to use.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fvfhj1o0j3uxscgojvmst.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fvfhj1o0j3uxscgojvmst.png" alt="gotit" width="800" height="863"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks in advance for reading this article...🚀&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I am more than happy to connect with you on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/_nitinreddy3" rel="noopener noreferrer"&gt;@twitter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/nitinreddy3/" rel="noopener noreferrer"&gt;@LinkedIn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;You can also find me on&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/nitinreddy3" rel="noopener noreferrer"&gt;@Github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/nitinreddy3"&gt;@DEV&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>forms</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
