<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dipesh Pal on Medium]]></title>
        <description><![CDATA[Stories by Dipesh Pal on Medium]]></description>
        <link>https://medium.com/@dipeshpal17?source=rss-f438a2ca19ab------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*zVVX-cmCMYqojtEv.jpg</url>
            <title>Stories by Dipesh Pal on Medium</title>
            <link>https://medium.com/@dipeshpal17?source=rss-f438a2ca19ab------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 16:09:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dipeshpal17/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Fix AI Character Consistency When Midjourney Keeps Breaking Your Shots]]></title>
            <link>https://medium.com/analytics-vidhya/how-to-fix-ai-character-consistency-when-midjourney-keeps-breaking-your-shots-ab886530185d?source=rss-f438a2ca19ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab886530185d</guid>
            <category><![CDATA[ai-image-generator-free]]></category>
            <category><![CDATA[ai-video-generator]]></category>
            <category><![CDATA[ai-image-generator]]></category>
            <category><![CDATA[text-to-image-generation]]></category>
            <category><![CDATA[imaginestacks]]></category>
            <dc:creator><![CDATA[Dipesh Pal]]></dc:creator>
            <pubDate>Thu, 26 Mar 2026 20:58:18 GMT</pubDate>
            <atom:updated>2026-03-26T20:58:18.897Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eLMvWyry7Ll0zGmnC6wHUw.jpeg" /></figure><p>Generate a character in Midjourney. Now generate that same character in a different pose. You’ll get a stranger.</p><p>This isn’t a prompt problem. It isn’t a skill problem. It’s an architecture problem and <a href="https://llamagen.ai/cs/blogs/ai-character-consistency-solutions-2025">a 2025 industry analysis</a> puts a hard number on the cost of getting it wrong: 92% audience dropout rate for visually inconsistent characters, and 3.7× higher engagement for productions that maintain consistent designs. That’s not an aesthetic preference. That’s a production liability. And 78% of studios now require AI consistency tools as part of their pipeline.</p><p>If you’re an animator or concept artist trying to build a multi-shot sequence, this post is the one you needed six frustrated hours ago.</p><h3>Why Midjourney Wasn’t Built for This</h3><p>Midjourney is, genuinely, one of the best tools available for single-image concept work. The outputs are beautiful. The aesthetic range is remarkable. It is the wrong tool for multi-shot character work, full stop — and understanding why saves you from weeks of trying to fix something that can’t be fixed from the prompt side.</p><p>The core issue is architectural. Midjourney is a closed, prompt-driven system. There’s no native ControlNet support, no LoRA fine-tuning access, and no reference-image anchoring in any traditional sense. Every generation is stateless. When you hit generate, the model doesn’t retrieve your character it reconstructs one from scratch, guided by your text prompt, its training data, and the sampling process. As <a href="https://www.vidmodel.ai/en/blog/why-ai-characters-are-hard-to-keep-consistent">VidModel.ai’s technical breakdown</a> frames it: AI characters are not persistent entities. They’re outcomes — temporary visual solutions generated to satisfy current constraints.</p><p>This means facial structure drifts between shots. Outfits mutate. Body proportions shift. These aren’t glitches you can patch with a longer prompt. They’re the predictable output of a system with no identity-anchoring mechanism. The model re-infers who your character is every single time, and when the pose, lighting, or composition changes, so does the inference.</p><p>Midjourney’s --sref (style reference) and --cref (character reference) flags are genuine attempts to address this, and they help at the margins. But they&#39;re still operating within a closed black box. You get some influence, not structural control. For a two-shot comparison image, that might be fine. For a twelve-shot animation sequence where character drift is immediately visible, it isn&#39;t.</p><h3>What Consistency Actually Requires</h3><p>Strip away all the tooling debates and the technical prerequisites for real character consistency come down to three things: a visual anchor the model can reference, a structural conditioning mechanism that constrains pose and composition without reconstructing identity, and — for maximum reliability model-level fine-tuning that trains recognition of your specific character.</p><p><a href="https://renderfire.com/blog/character-consistency-ai-generation">Renderfire’s analysis of professional consistency workflows</a> names the same three levers: reference image anchoring, IP adapters, and face-lock technologies. These are not interchangeable with prompt engineering. A more detailed text description of your character’s eye color and jaw shape does not give the model anything structurally different to work with it’s still interpreting text through its probabilistic process.</p><p>The honest tradeoff here is worth stating clearly: stronger constraints reduce spontaneity. A workflow that tightly locks your character’s identity will be less free-form than firing off prompts and seeing what emerges. That’s the correct engineering choice for multi-shot work. You’re not working around a limitation you’re trading creative randomness for production reliability, which is exactly the right trade.</p><p>This tradeoff also determines platform choice. You need access to the actual model controls: ControlNet conditioning, img2img pipelines, model selection. A chat interface over a black-box model cannot give you this. A platform that exposes the underlying models can.</p><h3>The Workflow That Actually Fixes It: Img2Img + ControlNet</h3><p>ControlNet is the core tool for multi-shot character consistency. The mechanism is straightforward: instead of generating from text alone, you feed the model a reference image as a structural anchor. The model uses that anchor to constrain the output’s spatial structure pose, composition, proportions while the text prompt handles the contextual changes you actually want (new scene, different expression, altered lighting).</p><p>The practical result: your character’s identity travels with the image through every generation, rather than being reconstructed from text each time.</p><p><a href="https://www.imaginestacks.com/">Imaginestacks</a> provides ControlNet as a core model in its image-to-image workflow you can see it alongside the full model lineup on the <a href="https://www.imaginestacks.com/models">models page</a>. The anime restyle example the platform uses to demonstrate ControlNet illustrates the key principle precisely: the source image anchors the structural identity while the output transforms context and style. That’s the same mechanism you’d use for character consistency across shot types.</p><p>For the base model layer, the choice between SDXL 1.0 and SD 1.5 matters. SDXL 1.0 is the right call for photorealistic or high-detail character renders it handles fine facial detail, texture, and realism better. SD 1.5 is well-suited to stylized or illustrative work, including the steampunk and stylized-portrait use cases. Both are available on the platform. Choose based on your target aesthetic, not because one is universally better.</p><p>One thing that’s easy to underestimate: the quality of your initial reference image determines the ceiling for every shot that follows. A blurry, low-contrast, or three-quarter-angled hero render will produce weaker anchoring across the whole sequence. Spend real time on shot one. A sharp, well-lit, front-facing render with clear detail across face, outfit, and proportions becomes the source of truth your ControlNet passes will draw from. Get this right before generating anything else.</p><h3>Moving Into Motion: Where SVD 1.1 and AnimateDiff Come In</h3><p>Once your character holds across stills, the next problem is animation. This is where image-to-video models earn their place in the pipeline — and where the distinction between them matters.</p><p>SVD 1.1 (Stable Video Diffusion), <a href="https://www.imaginestacks.com/models">available on Imaginestacks</a>, takes a single still image as input and animates it. The character’s identity is already locked in the input frame the model’s job is to generate motion, not to reconstruct who the character is. This is meaningfully different from text-to-video generation, where the model is building identity and motion simultaneously from a text description. For character-critical animation, the image-to-video path is more reliable.</p><p>AnimateDiff, also available on the platform, is powerful for generative video — particularly useful when you want rich, prompt-driven scene generation. But for sequences where character identity is the constraint you can’t compromise on, starting from a ControlNet-processed still and feeding it into SVD 1.1 gives you stronger control over the output.</p><p>Think of it this way: a landscape hyperlapse preserves visual identity through motion because there’s a reference frame driving the output. The same principle applies to character work. The still you feed into SVD 1.1 is that reference frame and if that still was generated through a ControlNet img2img pass anchored to your hero reference, you’ve carried consistency through two model stages.</p><h3>What a Real Three-Shot Sequence Looks Like</h3><p>Abstract workflow descriptions only go so far. Here’s what this actually looks like for a concrete three-shot character sequence: introduction (front-facing, neutral), action (side profile, motion), reaction close-up.</p><p>Shot one is your foundation. Generate the hero reference using SDXL 1.0 with a detailed prompt covering facial features, outfit specifics, and lighting conditions. This image is your identity anchor for everything that follows. Don’t rush it. Run multiple passes if needed this is where your consistency budget is spent, not in subsequent shots.</p><p>Shot two goes through ControlNet Img2Img. Feed shot one as the reference image. Adjust your prompt for the new pose and scene context while keeping character-specific descriptors consistent. ControlNet constrains the structural elements your character’s proportions and key facial geometry while the prompt shifts carry the compositional change. The output should read as the same character from a different angle, not a similar-looking stranger.</p><p>Shot three uses SVD 1.1 with shot two’s output as the input frame. At this point you’re animating identity that’s already been established and carried through two model passes. The motion generation preserves what ControlNet locked down. You’re not starting over you’re extending.</p><p>Imaginestacks runs on a <a href="https://www.imaginestacks.com/models">transparent, credits-based pay-as-you-go pricing structure</a> with no hidden fees. Video generation is priced at 123 credits per second at 720p. For iterative workflows and multi-shot consistency work is inherently iterative, since you’ll be running multiple passes to nail each stage — this model means you only pay for what you generate. There’s no wasted subscription cost on sessions where you’re primarily reviewing and discarding outputs.</p><h3>The Trap Most People Fall Into First</h3><p>The near-universal first response to consistency failures is a longer, more detailed prompt. Add more physical descriptors. Specify the eye color more precisely. Include the outfit details more explicitly. This feels productive. It doesn’t work.</p><p><a href="https://prompting.systems/blog/creating-consistent-characters-in-ai-art">The consistency problem is architectural, not semantic</a>. The model isn’t forgetting your character description between generations it’s reconstructing identity from scratch using that description as one input among many. A more detailed prompt gives the reconstruction process more to work with, but it doesn’t change the fact that reconstruction is happening at all. You’re refining a fundamentally unstable process, not replacing it with a stable one.</p><p>The moment you diagnose this correctly, the solution becomes obvious: stop trying to describe your character more precisely, and start giving the model a structural anchor it can actually use. Reference images, ControlNet conditioning, img2img pipelines these are the tools that address the actual problem. Prompt engineering is useful for quality and style. It is not a consistency mechanism.</p><p>The animators and concept artists getting reliable multi-shot work out of AI generation have made a specific workflow shift from prompt-only tools to platforms that expose the actual consistency controls. If you’re currently fighting this on Midjourney, the fix isn’t a better prompt. <a href="https://www.imaginestacks.com/">Start a session on Imaginestacks</a>, generate a strong reference still using SDXL 1.0, and run it through ControlNet Img2Img for your next shot. The Basic plan starts at ₹99 — low enough to test the full reference → ControlNet → SVD 1.1 pipeline before committing to a full production. That single workflow change will shift what you think AI animation can produce.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab886530185d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/how-to-fix-ai-character-consistency-when-midjourney-keeps-breaking-your-shots-ab886530185d">How to Fix AI Character Consistency When Midjourney Keeps Breaking Your Shots</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing JarvisAI: Building Advanced AI Assistants and Chatbots Made Easy with JarvisAI and…]]></title>
            <link>https://dipeshpal17.medium.com/introducing-jarvisai-building-advanced-ai-assistants-and-chatbots-made-easy-with-jarvisai-and-ac9c9db350f4?source=rss-f438a2ca19ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac9c9db350f4</guid>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[chatgpt4]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[jarvisai]]></category>
            <category><![CDATA[virtual-assistant]]></category>
            <dc:creator><![CDATA[Dipesh Pal]]></dc:creator>
            <pubDate>Wed, 12 Apr 2023 15:54:29 GMT</pubDate>
            <atom:updated>2023-04-12T21:00:04.844Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introducing JarvisAI: Building Advanced AI Assistants and Chatbots Made Easy with JarvisAI and ChatGPT Integration</h3><p>Are you looking for an easy-to-use, customizable AI assistant that can perform a wide range of tasks? Look no further than JarvisAI, a Python module that is designed to provide base functionality for any assistant application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TsRtk8aTEa7sk86YdgHNIw.png" /></figure><p>Built using popular open-source libraries and frameworks, including Tensorflow, Pytorch, and Transformers, JarvisAI is a powerful tool that can help you create your own chatbot, assistant, and more. And the best part? You can contribute to this project to make it even more powerful. It also supports Chatgpt, you can read below in the premium plan section. Don’t worry it’s free plan also is enough to build a virtual assistant.</p><p><strong>Read Documents:</strong> <a href="https://github.com/Dipeshpal/Jarvis_AI">https://github.com/Dipeshpal/Jarvis_AI</a></p><p><strong>Get Free API Key:</strong> <a href="https://jarvisai.in/">https://jarvisai.in</a></p><p>Getting started with JarvisAI is easy. All you need is Python 3.6 or later, and you can install the latest version using pip:</p><pre>pip install JarvisAI</pre><p>Once you’ve installed JarvisAI, you can use the following code to create your own AI assistant-</p><pre>import JarvisAI<br><br>def custom_function(*args, **kwargs):<br>    command = kwargs.get(&#39;query&#39;)<br>    entities = kwargs.get(&#39;entities&#39;)<br>    print(entities)<br>    # write your code here to do something with the command<br>    # perform some tasks # return is optional<br>    return command + &#39; Executed&#39;<br><br><br>jarvis = JarvisAI.JarvisAI(input_mechanism=&#39;voice&#39;, output_mechanism=&#39;both&#39;,<br>                google_speech_api_key=None, backend_tts_api=&#39;pyttsx3&#39;,<br>                use_whisper_asr=False, display_logs=False,<br>                api_key=&#39;527557f2-0b67-4500-8ca0-03766ade589a&#39;)<br># add_action(&quot;general&quot;, custom_function)  # OPTIONAL<br>jarvis.start()</pre><h3>What it can do (Features it supports)-</h3><ol><li>Currently, it supports only the English language</li><li>Supports voice and text input/output.</li><li>Supports AI-based voice input (using whisper asr) and by using Google API voice input.</li><li>All intellectual task is processed in the JarvisAI server so there is no load on your system.</li><li>Lightweight and able to understand natural language (commands)</li><li>Ability to add your own custom functions.</li></ol><h3>Supported Commands-</h3><p>These are below supported intent that AI can handle, you can ask in natural language.</p><p><strong>Examples-</strong> “What is the time now”, “Make me laugh”, “Click a photo”, etc.</p><p><strong>Note: </strong>Some features / commands might not work. WIP. Tell me bugs.</p><ol><li>asking time</li><li>asking date</li><li>greet and hello hi kind of things goodbye</li><li>tell me joke</li><li>tell me about</li><li>I am bored</li><li>volume control</li><li>tell me news</li><li>click photo</li><li>places near me</li><li>play on youtube</li><li>play games</li><li>what can you do</li><li>send email</li><li>download youtube video</li><li>asking weather</li><li>take screenshot</li><li>open website</li><li>send WhatsApp message</li><li>covid cases</li><li>check internet speed</li><li>others / Unknown Intent</li></ol><h3>Supported Input/Output Methods (Which option do I need to choose?)-</h3><p>You can set the below parameter while creating an object of JarvisAI-</p><pre>jarvis = JarvisAI.Jarvis(input_mechanism=&#39;voice&#39;, output_mechanism=&#39;both&#39;,  <br>                google_speech_api_key=None, backend_tts_api=&#39;pyttsx3&#39;,  <br>                use_whisper_asr=False, display_logs=False,  <br>                api_key=&#39;527557f2-0b67-4500-8ca0-03766ade589a&#39;)</pre><p>For text input-</p><ul><li>input_mechanism=&#39;text&#39;</li></ul><p>For voice input-</p><ul><li>input_mechanism=&#39;voice&#39;</li></ul><p>For text output-</p><ul><li>output_mechanism=&#39;text&#39;</li></ul><p>For voice output-</p><ul><li>output_mechanism=&#39;text&#39;</li></ul><p>For voice and text output-</p><ul><li>output_mechanism=&#39;both&#39;</li></ul><h3>Free Plan-</h3><p>By default, you are enrolled in our free plan. However, it’s important to note that this plan is not equipped to handle the ‘others/unknown intent’ query. In other words, while on the free plan, you won’t be able to ask for everything the world has to offer, unlike our premium plan.</p><h3>Premium Plan-</h3><p>Upgrade to our premium plan and gain access to a host of benefits:</p><ol><li>Our AI system will be able to answer any question you ask, beyond just basic commands.</li><li>We can handle ‘others/unknown intent’ queries, which is not possible on the free plan.</li><li>We are committed to upgrading our service to use the advanced GPT-3 model in the future. Currently, we rely on our other custom AI models to answer queries.</li><li>Upon using your API key, your full potential will be unlocked.</li><li>Enjoy unlimited API calls for now. However, we may consider changing or limiting this later.</li><li>While we don’t currently store your personal chat information, we will soon be implementing a system to remember the context of previous chats.</li></ol><h3>Architecture</h3><p>JarvisAI’s architecture is divided into two parts.</p><ol><li>User End- It is basically responsible for getting input from the user and after preprocessing input, it sends input to JarvisAI’s server. And once the server sends its response back, it produces output on the user screen/system.</li><li>Server Side- The server is responsible to handle various kinds of AI-ML, and NLP tasks. It mainly identifies user intent by analyzing user input and interacting with other external APIs and handling user input.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*4e90lmQ-lWkuY1DD" /></figure><h3>Donate-</h3><p><a href="https://www.buymeacoffee.com/dipeshpal">Donate and Contribute to run me this project, and buy a domain</a></p><p><em>Feel free to use my code, and don’t forget to mention the credit. All the contributors will get credits in this repo.</em><br><em>Mention below the line for credits-</em><br><em>Credits-</em></p><ul><li><a href="https://jarvis-ai-api.herokuapp.com/">https://jarvis-ai-api.herokuapp.com</a></li><li><a href="https://github.com/Dipeshpal/Jarvis_AI">https://github.com/Dipeshpal/Jarvis_AI</a></li><li><a href="https://www.youtube.com/dipeshpal17">https://www.youtube.com/dipeshpal17</a></li><li><a href="https://www.instagram.com/dipesh_pal17/">https://www.instagram.com/dipesh_pal17</a></li></ul><h3>10. Thank me on-</h3><ul><li>Follow me on Instagram: <a href="https://www.instagram.com/dipesh_pal17/">https://www.instagram.com/dipesh_pal17</a></li><li>Subscribe me on YouTube: <a href="https://www.youtube.com/dipeshpal17">https://www.youtube.com/dipeshpal17</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac9c9db350f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Samsung Galaxy S23 Ultra: The Ultimate Smartphone Experience]]></title>
            <link>https://dipeshpal17.medium.com/samsung-galaxy-s23-ultra-the-ultimate-smartphone-experience-8866cc174d2d?source=rss-f438a2ca19ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/8866cc174d2d</guid>
            <category><![CDATA[new-launch]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[best-mobiles]]></category>
            <category><![CDATA[review]]></category>
            <dc:creator><![CDATA[Dipesh Pal]]></dc:creator>
            <pubDate>Thu, 09 Feb 2023 05:48:00 GMT</pubDate>
            <atom:updated>2023-02-09T05:48:00.919Z</atom:updated>
            <content:encoded><![CDATA[<p>The wait is finally over! The much-anticipated OnePlus 11 was officially announced on February 1st, 2023, and it is set to release on February 17th, 2023. This latest offering from OnePlus is a true testament to the company’s commitment to providing high-quality, innovative products to its customers. The OnePlus 11 promises to deliver a truly outstanding smartphone experience, and it’s sure to turn heads.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IPM5B2i8aF6uQA2Pc-lRwA.jpeg" /></figure><h3>Check our review on YouTube-</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FMAZxtm8MhiA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DMAZxtm8MhiA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FMAZxtm8MhiA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1f113fb254f95f8ddcf2d8f4cfeeb16d/href">https://medium.com/media/1f113fb254f95f8ddcf2d8f4cfeeb16d/href</a></iframe><p><strong>Design and Build Quality</strong></p><p>The OnePlus 11 boasts a sleek and sophisticated design, with a glass front and back that is protected by the latest Corning Gorilla Glass Victus 2. The aluminum frame has been designed with armor aluminum to offer better drop and scratch resistance, ensuring that the phone is both durable and stylish. It measures 163.4 x 78.1 x 8.9 mm and weighs 234g, making it comfortable to hold and use. Additionally, the phone is IP68 rated for dust and water resistance, and it can withstand submersion in water up to 1.5m for up to 30 minutes.</p><p><strong>Display</strong></p><p>The OnePlus 11 features a large 6.8-inch Dynamic AMOLED 2X display with a resolution of 1440 x 3088 pixels, offering a pixel density of 500ppi. The display is protected by Corning Gorilla Glass Victus 2 and is capable of displaying HDR10+ content, making it perfect for watching movies and TV shows, playing games, and more. The display also features a high refresh rate of 120Hz, ensuring smooth and responsive performance. An always-on display is also included, allowing users to see important information without having to turn on the screen.</p><p><strong>Performance and Software</strong></p><p>The OnePlus 11 is powered by the Qualcomm SM8550-AC Snapdragon 8 Gen 2 chipset and an octa-core CPU. This powerful setup is paired with the Adreno 740 GPU, providing smooth and efficient performance. The phone is available with 8GB or 12GB of RAM and internal storage options of 256GB, 512GB, or 1TB, with UFS 4.0 providing fast and reliable storage performance.</p><p>The phone runs on Android 13 and One UI 5.1, providing users with a modern and intuitive user interface. Additionally, the phone features Samsung DeX and Samsung Wireless DeX, which allow users to use the phone as a desktop computer by connecting it to a monitor, keyboard, and mouse.</p><p><strong>Camera</strong></p><p>The OnePlus 11 is equipped with a quad-camera setup on the rear, consisting of a 200MP wide camera, a 10MP periscope telephoto camera, a 10MP telephoto camera, and a 12MP ultrawide camera. This setup provides users with a wide range of photography options, including 10x optical zoom, 3x optical zoom, and super steady video. The front-facing camera is a 12MP sensor, which is capable of capturing high-quality selfies and videos. The cameras are supported by features such as LED flash, auto-HDR, and panorama, making it easy to capture stunning photos and videos.</p><p><strong>Sound</strong></p><p>The Oneplus 11 features stereo speakers and has been tuned by AKG for an exceptional audio experience. The device does not have a 3.5mm headphone jack but supports 32-bit/384kHz audio.</p><p><strong>Communication</strong></p><p>The Oneplus 11 has Wi-Fi 802.11 a/b/g/n/ac/6e and Bluetooth 5.3 for wireless connectivity. It also has GPS, GLONASS, BDS, and GALILEO for location tracking and NFC for wireless payments. The device also has a USB Type-C port for charging and data transfer.</p><p><strong>Features</strong></p><p>The Oneplus 11 is equipped with an under-display fingerprint sensor, accelerometer, gyro, proximity, compass, and barometer sensors. It also supports Samsung DeX and Samsung Wireless DeX for a desktop computing experience. Additionally, the device has Bixby natural language commands and dictation and supports Samsung Pay for wireless payments.</p><p><strong>Battery</strong></p><p>The Oneplus 11 is powered by a 5000 mAh non-removable Li-Ion battery and supports 45W wired charging and 15W wireless charging. The device also supports reverse wireless charging.</p><p><strong>Colors and Price</strong></p><p>The Oneplus 11 is available in Phantom Black, Green, Cream, Lavender, Graphite, Sky Blue, Lime, and Red. The device is priced at ₹124,999 / $1,115.00.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8866cc174d2d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Tutorial: Python Is All You Need]]></title>
            <link>https://dipeshpal17.medium.com/python-tutorial-python-is-all-you-need-5562e93cf49e?source=rss-f438a2ca19ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/5562e93cf49e</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[free-python-tutorials]]></category>
            <category><![CDATA[python-quick]]></category>
            <dc:creator><![CDATA[Dipesh Pal]]></dc:creator>
            <pubDate>Sat, 28 Jan 2023 13:20:56 GMT</pubDate>
            <atom:updated>2023-01-28T13:20:56.296Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K5_U2-XpMveo0Bvd2MPZ_g.png" /><figcaption>Python Is All You Need</figcaption></figure><p>Welcome to the “Python Is All You Need” tutorial series! In this series, we will be diving into the world of Python programming, starting from the basics and working our way up to more advanced topics. Python is a powerful and versatile programming language that can be used for a wide range of tasks, from web development to data analysis to machine learning. Whether you’re a beginner looking to learn your first programming language or an experienced developer looking to add Python to your toolset, this series has something for you.</p><p>Throughout the course, we’ll be using real-world examples and hands-on exercises to help you understand and apply the concepts you learn. This course also has video-based tutorials as well.</p><p>By the end of the series, you’ll have the knowledge and skills you need to start using Python to solve problems and build projects on your own. So let’s get started!</p><p><strong>Buy Python Ebook at only RS. 59 (INR):</strong> <a href="https://techport.stores.instamojo.com/product/3513410/python-is-all-you-need/">https://techport.stores.instamojo.com/product/3513410/python-is-all-you-need/</a></p><p><strong>Python Tutorial Playlist:</strong> <a href="https://www.youtube.com/playlist?list=PLIfUaQYD8YwhKvTnfbCZa6YUDRTAd9QZD">https://www.youtube.com/playlist?list=PLIfUaQYD8YwhKvTnfbCZa6YUDRTAd9QZD</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F8ODYnGrEOb8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D8ODYnGrEOb8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F8ODYnGrEOb8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b7c50b9d89f067396ef021928f4b188/href">https://medium.com/media/2b7c50b9d89f067396ef021928f4b188/href</a></iframe><h3><strong>1. What is Python?</strong></h3><p>Python is a high-level, interpreted programming language that is widely used for web development, data analysis, artificial intelligence, and scientific computing. It is known for its simplicity and easy-to-read syntax, making it an excellent language for beginners to learn.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FHybBknpxcmk%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DHybBknpxcmk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FHybBknpxcmk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/10cc5540166c198ce8cc19a84aec5fb2/href">https://medium.com/media/10cc5540166c198ce8cc19a84aec5fb2/href</a></iframe><h3><strong>2. Why Python?</strong></h3><p>Python is a versatile language that can be used for a wide range of tasks, from web development to data analysis. It also has a large and active community, which means there are many resources and libraries available to help you with your projects. Additionally, Python is in high demand in the job market, making it a valuable skill to have.</p><h3><strong>3. Getting Started To get started with Python</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FVegUnq8olss%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DVegUnq8olss&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FVegUnq8olss%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/bb1f6912ce95733cb87a061508f56917/href">https://medium.com/media/bb1f6912ce95733cb87a061508f56917/href</a></iframe><p>You will need to first download and install the software on your computer. You can download Python from the official website at <a href="https://www.python.org/">python.org.</a></p><h3><strong>4. Installation</strong></h3><p>To install Python, simply download the installer for your operating system and run it. The installer will guide you through the installation process. Once you have installed Python, you can start writing and running your own Python code.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F9WNEMKwuSf0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D9WNEMKwuSf0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F9WNEMKwuSf0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ae6fa5f84075288adad5e3ef8b66822a/href">https://medium.com/media/ae6fa5f84075288adad5e3ef8b66822a/href</a></iframe><h3><strong>5. Where and How to Code</strong></h3><p>There are a few different ways to write and run Python code. One popular option is to use an integrated development environment (IDE) like PyCharm or IDLE. These programs provide a text editor and a console for running your code. Another option is to use a simple text editor like Notepad and run your code in the command line.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FkI9LIQVLXFI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DkI9LIQVLXFI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FkI9LIQVLXFI%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ddd78d63acdfdcd61aa1fcf246a296f8/href">https://medium.com/media/ddd78d63acdfdcd61aa1fcf246a296f8/href</a></iframe><h3><strong>6. First Program</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F3b8YU_CZtKE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D3b8YU_CZtKE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F3b8YU_CZtKE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a8c78248a8ca1cb23824743127cc3676/href">https://medium.com/media/a8c78248a8ca1cb23824743127cc3676/href</a></iframe><p>To write your first Python program, open up an IDE or text editor and start a new file. In this file, you can write Python code and save it with a .py file extension. Here’s an example of a simple Python program that prints “Hello, World!” to the console</p><pre>print(&quot;Hello, World!&quot;)</pre><h3>7. <strong>Keywords and Identifiers</strong></h3><p>In Python, keywords are predefined words that have a specific meaning and cannot be used as identifiers. Some examples of Python keywords include “if”, “else”, and “for”. Identifiers, on the other hand, are used to name variables, functions, and other elements in a Python program. They can be any combination of letters, numbers, and underscores, but cannot start with a number.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F0vg6N8mvT3E%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D0vg6N8mvT3E&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F0vg6N8mvT3E%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/28cb547cf3903d93d44c96f66d36226a/href">https://medium.com/media/28cb547cf3903d93d44c96f66d36226a/href</a></iframe><h3><strong><em>8. Comments, Statement, and Indentation</em></strong></h3><p>In Python, comments are used to explain what a particular piece of code is doing. They are ignored by the Python interpreter and start with the “#” symbol. An example of a comment in Python would be:</p><pre># This is a comment</pre><p><strong>Statements</strong> in Python are used to perform actions, such as assigning a value to a variable or calling a function. Indentation is used to indicate the structure of the program and to separate different code blocks.</p><h3>9. <strong>Python Variables, Constants, and Literals</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F0vg6N8mvT3E%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D0vg6N8mvT3E&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F0vg6N8mvT3E%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/28cb547cf3903d93d44c96f66d36226a/href">https://medium.com/media/28cb547cf3903d93d44c96f66d36226a/href</a></iframe><p>In Python, variables are used to store data, constants are used to store data that will not change, and literals are used to represent fixed values in the code. Here is an example of a variable and a constant being defined in Python:</p><pre>x = 5 # variable<br>PI = 3.14 # constant</pre><h3>10. <strong>Python Data Types</strong></h3><p>Python is a powerful programming language that provides a wide range of data types to work with. In this article, we will take a closer look at some of the most commonly used data types in Python: numeric, string, list, tuple, and dictionary.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FL7_wEeVETks%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DL7_wEeVETks&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FL7_wEeVETks%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/afa213ae1b765a026f5e45069124c66f/href">https://medium.com/media/afa213ae1b765a026f5e45069124c66f/href</a></iframe><p><strong><em>Python Numeric Data Type</em></strong></p><p>Numeric data types include integers (int) and floating-point numbers (float). For example, the following code defines a variable x as an integer with a value of 10:</p><pre>x = 10<br>print(x)<br><br>#Similarly, we can define a variable y as a floating-point number with a value of 3.14:<br>y = 3.14<br>print(y)</pre><p><strong><em>Python String Data Type</em></strong></p><p>Strings in Python are sequences of characters enclosed in quotation marks (either single or double). For example, the following code defines a variable s as a string with a value of “Hello, World!”:</p><pre>s = &quot;Hello, World!&quot;<br>print(s)<br><br># In Python, we can also use the + operator to concatenate strings together. For example:<br>s1 = &quot;Hello&quot;<br>s2 = &quot;World&quot;<br>s3 = s1 + &quot; &quot; + s2<br>print(s3)</pre><p><strong><em>Python List Data Type</em></strong></p><p>A list in Python is an ordered collection of items. Lists are enclosed in square brackets [] and items are separated by commas. For example, the following code defines a variable lst as a list of integers:</p><pre>lst = [1, 2, 3, 4, 5]<br>print(lst)<br><br># We can also use the append() method to add an item to a list. For example:<br>lst.append(6)<br>print(lst)</pre><p><strong><em>Python Tuple</em></strong></p><p>A tuple is similar to a list in Python, but it is immutable, meaning that its elements cannot be changed once defined. Tuples are also enclosed in parentheses () and commas as separate items. For example, the following code defines a variable t as a tuple of integers:</p><pre>t = (1, 2, 3, 4, 5)<br>print(t)</pre><p>We cannot add or remove items from a tuple, but we can access them by index. For example:</p><pre>print(t[2])</pre><p><strong><em>Python Dictionary</em></strong></p><p>A Python dictionary is an unordered collection of items, each with a key-value pair. Dictionaries are also known as associative arrays or hash maps in other programming languages. They are enclosed by curly braces { } and values can be assigned and accessed using square brackets []. The keys of a dictionary must be unique and of an immutable data type, such as strings or numbers.</p><pre># Creating a dictionary<br>my_dict = {&#39;name&#39;: &#39;John&#39;, &#39;age&#39;: 25, &#39;gender&#39;: &#39;male&#39;}<br><br># Accessing values using keys<br>print(my_dict[&#39;name&#39;])  # Output: &#39;John&#39;<br>print(my_dict[&#39;age&#39;])   # Output: 25<br><br># Adding new key-value pair<br>my_dict[&#39;location&#39;] = &#39;New York&#39;<br><br># Updating values using keys<br>my_dict[&#39;age&#39;] = 30<br><br># Deleting a key-value pair<br>del my_dict[&#39;gender&#39;]<br><br># Print the dictionary<br>print(my_dict)<br># Output: {&#39;name&#39;: &#39;John&#39;, &#39;age&#39;: 30, &#39;location&#39;: &#39;New York&#39;}</pre><p>In the above example, a dictionary my_dict is created with three key-value pairs, &#39;name&#39;, &#39;age&#39; and &#39;gender&#39;. We can access the values of the dictionary using the keys. We can also add new key-value pairs, update existing values and delete key-value pairs from the dictionary.</p><h3>11. <strong>Python Type Conversion and Type Casting</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F3dW2YsfzGjg%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D3dW2YsfzGjg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F3dW2YsfzGjg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a297094097e61118bc7fe82a2f55be49/href">https://medium.com/media/a297094097e61118bc7fe82a2f55be49/href</a></iframe><p><strong>Type Conversion:</strong> In Python, type conversion refers to the process of converting one data type to another. For example, converting an integer to a string or a float to an integer.</p><p><strong>Implicit Type Conversion:</strong> Implicit type conversion, also known as “type coercion,” is the automatic conversion of one data type to another. This can occur when performing operations on mixed data types. For example, when adding an integer and a float, Python will implicitly convert the integer to a float before performing the addition.</p><pre>x = 5<br>y = 2.5<br>print(x+y)<br><br># Output: 7.5</pre><p>In this example, Python implicitly converts the integer x to a float before performing the addition operation, resulting in the output 7.5.</p><p><strong>Explicit Type Conversion: </strong>Explicit type conversion, also known as “<strong>type casting</strong>”, is the conversion of one data type to another using a specific function or method. Python provides several built-in functions for type casting, such as int(), float(), str(), etc.</p><pre>x = 5<br>y = &quot;10&quot;<br>z = int(y)<br>print(x+z)<br><br>Output: 15</pre><p>In this example, the string y is explicitly converted to an integer using the int() function, allowing it to be added to the integer x and resulting in the output 15.</p><h3>12. <strong>Python Input, Output, and Import statements</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F267DT7A2R2s%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D267DT7A2R2s&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F267DT7A2R2s%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1cc0ad09021f145143b9467fb00847be/href">https://medium.com/media/1cc0ad09021f145143b9467fb00847be/href</a></iframe><p>Python provides several built-in functions to handle input and output operations, as well as to import modules and packages. In this blog post, we will take a look at some of the most commonly used input and output functions, and how to use the import statement in Python.</p><p><strong><em>Input function</em></strong></p><p>The input() function is used to take input from the user in Python. The input is returned as a string, which can then be converted to any other data type as needed. For example, consider the following code:</p><pre>name = input(&quot;What is your name? &quot;)<br>print(&quot;Hello, &quot; + name + &quot;!&quot;)</pre><p>When this code is run, it will prompt the user to enter their name, and then print a greeting using the input.</p><p><strong><em>Output function</em></strong></p><p>The print() function is used to output or display text on the screen in Python. The print() function can take multiple arguments, and it will concatenate them together and print them to the screen. For example, consider the following code:</p><pre>x = 10<br>y = 20<br>print(&quot;The value of x is:&quot;, x)<br>print(&quot;The value of y is:&quot;, y)</pre><p>When this code is run, it will print the value of x and y on the screen.</p><p><strong><em>Import statement</em></strong></p><p>The import statement is used to include a module or package in a Python program. For example, the math module can be imported as follows:</p><pre>import math<br>print(math.sqrt(16))</pre><p>In this example, the sqrt() function from the math module is used to calculate the square root of 16.</p><p>In this way, we can use the Input, Output, and Import statements in python.</p><h3>13. <strong>Operators in Python</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FaZ1GzHz7HFE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DaZ1GzHz7HFE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FaZ1GzHz7HFE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/218217950a5a6a237fba76bcadb91582/href">https://medium.com/media/218217950a5a6a237fba76bcadb91582/href</a></iframe><p>Operators are special symbols in Python that carry out arithmetic or logical computation. The value that the operator operates on is called the operand. For example: in the expression 4 + 5 = 9, 4 and 5 are the operands and + is the operator that performs the addition.</p><p>We will be discussing the different types of operators available in Python including arithmetic, comparison, logical, bitwise, assignment and special operators.</p><p><strong>Arithmetic Operators:</strong> Arithmetic operators are used to perform mathematical operations like addition, subtraction, multiplication, and division. The following are the arithmetic operators in Python:</p><ul><li>+ (addition)</li><li>- (subtraction)</li><li>* (multiplication)</li><li>/ (division)</li><li>% (modulus)</li><li>** (exponentiation)</li><li>// (floor division)</li></ul><p>For example:</p><pre>x = 15<br>y = 4<br>print(x + y)  # Output: 19<br>print(x - y)  # Output: 11<br>print(x * y)  # Output: 60<br>print(x / y)  # Output: 3.75<br>print(x % y)  # Output: 3<br>print(x ** y)  # Output: 50625<br>print(x // y)  # Output: 3</pre><p><strong>Comparison Operators:</strong> Comparison operators are used to compare two values and return a Boolean value indicating whether the comparison is true or false. The following are the comparison operators in Python:</p><ul><li>== (equal to)</li><li>!= (not equal to)</li><li>&gt; (greater than)</li><li>&lt; (less than)</li><li>&gt;= (greater than or equal to)</li><li>&lt;= (less than or equal to)</li></ul><p>For example:</p><pre>x = 5<br>y = 8<br>print(x == y)  # Output: False<br>print(x != y)  # Output: True<br>print(x &gt; y)  # Output: False<br>print(x &lt; y)  # Output: True<br>print(x &gt;= y)  # Output: False<br>print(x &lt;= y)  # Output: True</pre><p><strong>Logical Operators:</strong> Logical operators are used to combine multiple conditions and return a Boolean value indicating whether the combined conditions are true or false. The following are the logical operators in Python:</p><ul><li>and (True if both conditions are true)</li><li>or (True if either condition is true)</li><li>not (True if the condition is false)</li></ul><p>For example:</p><pre>x = 5<br>print(x &gt; 0 and x &lt; 10)  # Output: True<br>print(x &gt; 0 or x &lt; 10)  # Output: True<br>print(not(x &gt; 0 and x &lt; 10))  # Output: False</pre><p><strong>Bitwise Operators:</strong> Bitwise operators are used to perform operations on binary numbers. The following are the bitwise operators in Python:</p><ul><li>&amp; (and)</li><li>| (or)</li><li>^ (xor)</li><li>~ (complement)</li><li>&amp;#8203;oaicite:{&quot;index&quot;:0,&quot;invalid_reason&quot;:&quot;Malformed citation &lt;&lt;(left shift)\n-&gt;&gt;&quot;}&amp;#8203; (right shift)</li></ul><p><strong>For example:</strong></p><pre>x = 5  # binary: 0101<br>y = 3  # binary: 0011<br>print(x &amp; y)  # Output: 1</pre><p><strong>Python Assignment Operators: </strong>In Python, assignment operators are used to assign values to variables. The basic assignment operator is the “=” operator, which assigns the value on the right side of the operator to the variable on the left side. Here are some examples of using the assignment operator:</p><pre>x = 5 # assigns the value 5 to the variable x<br>y = x + 2 # assigns the value of x + 2 to the variable y<br>z = &quot;hello&quot; # assigns the string &quot;hello&quot; to the variable z</pre><p>In addition to the basic assignment operator, Python also provides a number of shorthand assignment operators that allow you to perform a mathematical operation and then assign the result to a variable in a single line of code. Here are some examples of using shorthand assignment operators:</p><pre>x += 2 # adds 2 to the value of x and assigns the result to x<br>y *= 3 # multiplies the value of y by 3 and assigns the result to y<br>z /= 2 # divides the value of z by 2 and assigns the result to z</pre><p><strong>Python Special Operators: </strong>In addition to the basic assignment operator and the shorthand assignment operators, Python also provides a number of special operators that perform specific operations. Here are some examples of special operators:</p><p><strong><em>Identity Operators:</em></strong> is and is not The “is” operator is used to determine if two variables refer to the same object in memory. The “is not” operator is used to determine if two variables do not refer to the same object in memory. Here is an example of using the identity operators:</p><pre>x = [1, 2, 3] <br>y = [1, 2, 3] <br>z = x print(x is y) # False print(x is z) # True</pre><p><strong><em>Membership Operators: </em></strong>in and not in The “in” operator is used to determine if an element is present in a list or a string. The “not in” operator is used to determine if an element is not present in a list or a string. Here is an example of using the membership operators:</p><pre>x = [1, 2, 3] <br>print(1 in x) # True print(4 in x) # False</pre><h3><strong>14. Python If…Else Condition</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F2SYy86pJPes%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D2SYy86pJPes&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F2SYy86pJPes%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/b1275aee7d8941bcffea3fc5680da25e/href">https://medium.com/media/b1275aee7d8941bcffea3fc5680da25e/href</a></iframe><p>In Python, the if…else statement is used to control the flow of execution of a program based on a certain condition. The basic syntax of the if…else statement is as follows:</p><pre>if condition:<br>    # execute this block if the condition is true<br>else:<br>    # execute this block if the condition is false</pre><p>The condition in the if statement can be any expression that evaluates to either True or False. If the condition is True, the block of code following the if statement will be executed. If the condition is False, the block of code following the else statement will be executed.</p><p>Example:</p><pre>x = 5<br>if x &gt; 0:<br>    print(&quot;x is positive&quot;)<br>else:<br>    print(&quot;x is negative&quot;)<br><br># Output: x is positive</pre><p><strong><em>Python If Condition:</em></strong></p><p>The if statement in Python is used to check whether a certain condition is true or not. If the condition is true, a block of code will be executed. If the condition is false, the block of code will be skipped.</p><p>The basic syntax of the if statement is:</p><pre>if condition:<br>    # execute this block of code</pre><p>Example:</p><pre>x = 5<br>if x &gt; 0:<br>    print(&quot;x is positive&quot;)<br><br># Output: x is positive</pre><p><strong><em>Python Else Condition:</em></strong></p><p>The else statement in Python is used to execute a block of code when the if statement condition is false. The basic syntax of the else statement is:</p><pre>if condition:<br>    # execute this block of code<br>else:<br>    # execute this block of code</pre><p>Example:</p><pre>x = -5<br>if x &gt; 0:<br>    print(&quot;x is positive&quot;)<br>else:<br>    print(&quot;x is negative&quot;)<br><br># output: x is negative</pre><p><strong><em>Python Elif Condition:</em></strong></p><p>The elif (short for “else if”) statement in Python is used to check multiple conditions. The basic syntax of the elif statement is:</p><pre>if condition1:<br>    # execute this block of code<br>elif condition2:<br>    # execute this block of code<br>else:<br>    # execute this block of code</pre><p>Example:</p><pre>x = 0<br>if x &gt; 0:<br>    print(&quot;x is positive&quot;)<br>elif x == 0:<br>    print(&quot;x is zero&quot;)<br>else:<br>    print(&quot;x is negative&quot;)<br><br># Output: x is zero</pre><p><strong><em>Python Nested If statements:</em></strong></p><p>In Python, it is possible to nest if statements inside another if statement. This is called a nested if statement. The basic syntax of a nested if statement is:</p><pre>if condition1:<br>    # execute this block of code<br>    if condition2:<br>        # execute this block of code<br>    else:<br>        # execute this block of code<br>else:<br>    # execute this block of code</pre><p>Example:</p><pre>x = -5<br>y = 10<br>if x &gt; 0:<br>    print(&quot;x is positive&quot;)<br>    if y &gt; 0:<br>        print(&quot;y is positive&quot;)<br>    else:<br>        print(&quot;y is negative&quot;)<br>else:<br>    print(&quot;x is negative&quot;)</pre><h3>15. <strong>Python for Loop and while loop</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FASP5HblYRaM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DASP5HblYRaM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FASP5HblYRaM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7d003674b9933047a1e12a45cf8eb0ef/href">https://medium.com/media/7d003674b9933047a1e12a45cf8eb0ef/href</a></iframe><p>A for loop in Python is used to iterate over a sequence (such as a list, tuple, or string) and execute a block of code for each item in the sequence. The general syntax for a for loop is:</p><pre>for variable in sequence:<br>    # code to execute</pre><p>For example, to print each item in a list of numbers:</p><pre>numbers = [1, 2, 3, 4, 5]<br>for num in numbers:<br>    print(num)<br><br># Output: 1 2 3 4 5</pre><p>Looping Through a String We can also use a for loop to iterate over a string. Each time through the loop, the next character in the string will be assigned to the variable.</p><pre>word = &quot;hello&quot;<br>for letter in word:<br>    print(letter)<br><br># Output: h e l l o</pre><p><strong><em>The break Statement:</em></strong> The break statement is used to exit a for loop early, before it has iterated through all of the items in the sequence. For example:</p><pre>numbers = [1, 2, 3, 4, 5]<br>for num in numbers:<br>    if num == 3:<br>        break<br>    print(num)<br><br># Output: 1 2</pre><p><strong><em>The continue Statement:</em></strong> The continue statement is used to skip over the current item in the sequence and continue with the next item. For example:</p><pre>numbers = [1, 2, 3, 4, 5]<br>for num in numbers:<br>    if num == 3:<br>        continue<br>    print(num)<br><br># Output: 1 2 4 5</pre><p><strong><em>The range() Function: </em></strong>The range() function is used to generate a sequence of numbers. The general syntax for the range() function is:</p><pre>range(start, stop, step)</pre><p>For example, to generate a sequence of numbers from 1 to 5:</p><pre>for num in range(1,6):<br>    print(num)<br><br># Output: 1 2 3 4 5</pre><p><strong><em>Else in For Loop:</em></strong> The else clause in a for loop is executed when the loop has finished iterating through the sequence. For example:</p><pre>numbers = [1, 2, 3, 4, 5]<br>for num in numbers:<br>    print(num)<br>else:<br>    print(&quot;The loop is finished.&quot;)<br><br># Output: 1 2 3 4 5 The loop is finished.</pre><p><strong><em>Nested Loops:</em></strong> A nested loop is a loop that is inside of another loop. For example:</p><pre>for num1 in range(1,3):<br>    for num2 in range(1,4):<br>        print(num1, num2)<br># Output: 1 1 1 2 1 3 2 1 2 2 2 3</pre><p><strong><em>The pass Statement:</em></strong> The pass statement is used as a placeholder in Python. It does nothing when executed and is used to prevent an error if a block of code is empty. For example:</p><pre>for num in range(1,6):<br>    pass</pre><p>This code will not produce any output because the block of code inside the for loop is empty and only the pass statement is present.</p><p>In conclusion, loops are an essential part of any programming language.</p><h3>16. <strong>While Loop-</strong></h3><p>A while loop in Python is used to repeatedly execute a block of code as long as a certain condition is true. The general syntax for a while loop is:</p><pre>while condition:<br>    # code to execute</pre><p>For example, to print the numbers from 1 to 5:</p><pre>num = 1<br>while num &lt;= 5:<br>    print(num)<br>    num += 1<br><br># Output: 1 2 3 4 5</pre><p>It’s important to make sure that the condition will eventually be false, otherwise the loop will run forever, which is known as an infinite loop.</p><p>We can also use the break and continue statements inside a while loop just like in for loops. For example, to print the numbers from 1 to 5, but skip 3:</p><pre>num = 1<br>while num &lt;= 5:<br>    if num == 3:<br>        num += 1<br>        continue<br>    print(num)<br>    num += 1<br><br># Output: 1 2 4 5</pre><p>In conclusion, while loops are useful when we don’t know how many times we need to iterate in advance, or when we want to keep iterating until a certain condition is met.</p><h3><strong>17. List in Python-</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F04xPtwedpCM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D04xPtwedpCM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F04xPtwedpCM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/3aa908b167f035f38490f14e236677f6/href">https://medium.com/media/3aa908b167f035f38490f14e236677f6/href</a></iframe><p>A list in Python is an ordered collection of items, which can be of any data type (strings, integers, etc.). The items in a list are enclosed in square brackets [], and separated by commas. For example:</p><pre>fruits = [&quot;apple&quot;, &quot;banana&quot;, &quot;cherry&quot;]</pre><p><strong><em>List Items —</em></strong> Data Types A list can contain items of different data types, for example:</p><pre>mixed_list = [&quot;apple&quot;, 2, 3.14, True]</pre><p>What is the data type of a list? In Python, a list is an instance of the list class and its data type is also list. You can use the type() function to check the data type of a variable, for example:</p><pre>fruits = [&quot;apple&quot;, &quot;banana&quot;, &quot;cherry&quot;]<br>print(type(fruits))</pre><p>Output:</p><pre>&lt;class &#39;list&#39;&gt;</pre><p><strong><em>Access Items</em></strong> We can access the items in a list by referring to their index number. The index numbers start from 0. For example:</p><pre>fruits = [&quot;apple&quot;, &quot;banana&quot;, &quot;cherry&quot;]<br>print(fruits[1])</pre><p>Output:</p><pre>banana</pre><p><strong><em>Change List Items</em></strong> We can change an item in a list by referring to its index number. For example:</p><pre>fruits = [&quot;apple&quot;, &quot;banana&quot;, &quot;cherry&quot;]<br>fruits[1] = &quot;orange&quot;<br>print(fruits)</pre><p>Output:</p><pre>[&quot;apple&quot;, &quot;orange&quot;, &quot;cherry&quot;]</pre><p><strong><em>Add Items List</em></strong> We can add an item to a list using the append() method. For example:</p><pre>fruits = [&quot;apple&quot;, &quot;banana&quot;, &quot;cherry&quot;]<br>fruits.append(&quot;orange&quot;)<br>print(fruits)</pre><p>Output:</p><pre>[&quot;apple&quot;, &quot;banana&quot;, &quot;cherry&quot;, &quot;orange&quot;]</pre><p><strong><em>List Methods</em></strong></p><p>There are many built-in methods available for lists in Python, some of the most commonly used methods are:</p><ul><li>append() - Adds an element to the end of the list.</li><li>extend() - Adds all the elements of an iterable (list, tuple, etc.) to the end of the list.</li><li>insert() - Inserts an element at a specified position.</li><li>remove() - Removes the first occurrence of the specified element.</li><li>pop() - Removes the element at the specified position.</li><li>clear() - Removes all the elements from the list.</li><li>index() - Returns the index of the first occurrence of the specified element.</li><li>count() - Returns the number of times the specified element appears in the list.</li><li>sort() - Sorts the list in ascending order.</li><li>reverse() - Reverses the order of the list.</li></ul><p>In conclusion, Lists are one of the most commonly used data structures in Python, they allow us to store multiple items in a single variable and perform various operations on them.</p><h3><strong>18. Tuples in Python</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FM0zy-Ag1DbQ%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DM0zy-Ag1DbQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FM0zy-Ag1DbQ%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/875180c43e27707bb29cc1b59fee9cdf/href">https://medium.com/media/875180c43e27707bb29cc1b59fee9cdf/href</a></iframe><p>A tuple is a collection of ordered and immutable elements. They are similar to lists in Python, but unlike lists, tuples cannot be modified once created. This makes them useful for storing data that should not be changed, such as the coordinates of a point in a 2D space.</p><p><strong><em>Creating a Tuple</em></strong></p><p>Creating a tuple is simple. You can create an empty tuple by using the tuple() function with no arguments, or by using the parentheses () with no elements inside. Here’s an example of creating a tuple with some elements:</p><pre># Creating a tuple with elements<br>my_tuple = (1, 2, 3, 4, 5)<br>print(my_tuple) # (1, 2, 3, 4, 5)</pre><pre># Creating an empty tuple<br>my_empty_tuple = tuple()<br>print(my_empty_tuple) # ()</pre><p><strong><em>Accessing of Tuples</em></strong></p><p>Accessing the elements of a tuple is similar to accessing the elements of a list. You can use the indexing operator [] to access an element of the tuple. Here’s an example:</p><pre># Accessing the first element of the tuple<br>first_element = my_tuple[0]<br>print(first_element) # 1</pre><pre># Accessing the last element of the tuple<br>last_element = my_tuple[-1]<br>print(last_element) # 5</pre><p><strong><em>Concatenation of Tuples</em></strong></p><p>You can concatenate two tuples by using the + operator. Here’s an example:</p><pre># Concatenating two tuples<br>tuple1 = (1, 2, 3)<br>tuple2 = (4, 5, 6)<br>concatenated_tuple = tuple1 + tuple2<br>print(concatenated_tuple) # (1, 2, 3, 4, 5, 6)</pre><p><strong><em>Deleting a Tuple</em></strong></p><p>Tuples are immutable, so you cannot delete an element from a tuple. However, you can delete the entire tuple using the del keyword. Here’s an example:</p><pre># Deleting a tuple<br>del my_tuple</pre><p><strong><em>Built-In Methods</em></strong></p><p>There are a few built-in methods that you can use with tuples. For example, you can use the count() method to count the number of occurrences of a specific element in a tuple. Here’s an example:</p><pre># Counting the occurrences of an element<br>my_tuple = (1, 2, 3, 3, 4, 5)<br>count = my_tuple.count(3)<br>print(count) # 2</pre><p><strong><em>Built-In Functions</em></strong></p><p>There are also a few built-in functions that you can use with tuples. For example, you can use the len() function to find the length of a tuple. Here’s an example:</p><pre># Finding the length of a tuple<br>my_tuple = (1, 2, 3, 4, 5)<br>length = len(my_tuple)<br>print(length) # 5</pre><p><strong><em>Tuples VS Lists</em></strong></p><p>In Python, both tuples and lists are used to store multiple values. However, there are a few key differences between the two:</p><ul><li>The main difference between tuples and lists in Python is that tuples are immutable, meaning their elements cannot be modified once they are created, while lists are mutable, meaning their elements can be modified. This makes tuples useful for storing data that should not be changed, such as the coordinates of a point in a 2D space, while lists are more suitable for storing data that can be changed, such as a list of items in a shopping cart. Additionally, tuples are generally faster and use less memory than lists because they are immutable, while lists require more memory to allow for changes to be made.</li><li>Another difference is that Tuples can be used as key in a dictionary while lists cannot be used.</li><li>In summary, tuples are more efficient and suitable for storing data that should not be modified, while lists are more flexible and suitable for storing data that can be modified.</li></ul><h3><strong>19. Dictionary in Python</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FxNz75oC-Ieo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DxNz75oC-Ieo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FxNz75oC-Ieo%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/4c62c49d5fba7316c7275ad58c9fb98a/href">https://medium.com/media/4c62c49d5fba7316c7275ad58c9fb98a/href</a></iframe><p>A dictionary in Python is an unordered collection of items, where each item is a key-value pair. Dictionaries are enclosed in curly braces { } and values can be accessed by keys. They are also known as associative arrays, maps, or hash maps.</p><p><strong><em>Creating a Python Dictionary</em></strong></p><p>Creating a dictionary in Python is as simple as enclosing a comma-separated list of key-value pairs in curly braces. The keys must be unique, but the values do not have to be. Here is an example of creating a dictionary:</p><pre># Creating a dictionary<br>my_dict = {&#39;name&#39;: &#39;John&#39;, &#39;age&#39;: 25, &#39;city&#39;: &#39;New York&#39;}<br>print(my_dict)</pre><p><strong><em>Accessing Elements from Dictionary</em></strong></p><p>You can access the elements of a dictionary by referring to its key name, inside square brackets []. Here is an example of accessing a value from a dictionary:</p><pre># Accessing a value from a dictionary<br>name = my_dict[&#39;name&#39;]<br>print(name)</pre><p><strong><em>Changing and Adding Dictionary Elements</em></strong></p><p>You can change the value of a specific item by referring to its key name. If the key is not present, a new (key: value) pair is added to the dictionary. Here is an example of changing a value in a dictionary:</p><pre># Changing a value in a dictionary<br>my_dict[&#39;age&#39;] = 30<br>print(my_dict)</pre><pre># Adding a new key-value pair to the dictionary<br>my_dict[&#39;gender&#39;] = &#39;male&#39;<br>print(my_dict)</pre><p><strong><em>Removing elements from Dictionary</em></strong></p><p>You can remove a particular item in a dictionary by using the pop() method. This method removes an item with the provided key and returns the value. The popitem() method can be used to remove and return an arbitrary (key, value) item pair. The del keyword can also be used to remove individual items or the entire dictionary itself. Here is an example of removing an item from a dictionary:</p><pre># Removing an item from a dictionary<br>my_dict.pop(&#39;gender&#39;)<br>print(my_dict)</pre><pre># Removing an arbitrary (key, value) pair<br>my_dict.popitem()<br>print(my_dict)</pre><pre># Removing the entire dictionary<br>del my_dict</pre><p><strong><em>Python List Comprehension</em></strong></p><p>List comprehension is a concise and memory-efficient way to create lists in Python. It is a syntactic construct that allows you to create a new list by applying an expression to each item in an existing list, and optionally filtering the items based on a condition. Here is an example of using list comprehension to create a new list of squares:</p><pre># Using list comprehension to create a new list of squares<br>squares = [x**2 for x in range(10)]<br>print(squares)</pre><h4><strong><em>Python Dictionary Comprehension</em></strong></h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FtCmeXIYOCTI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DtCmeXIYOCTI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FtCmeXIYOCTI%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/b8ee54dc9fb5d981562a46ea1ef284ab/href">https://medium.com/media/b8ee54dc9fb5d981562a46ea1ef284ab/href</a></iframe><p>Dictionary comprehension is a concise and memory-efficient way to create dictionaries in Python. It is similar to list comprehension but with a key-value pair format. Here is an example of using dictionary comprehension to create a new dictionary of squares:</p><pre># Using dictionary comprehension to create a new dictionary of squares<br>squares_dict = {x: x**2 for x in range(10)}<br>print(squares_dict)</pre><h3><strong>20. Sets in Python</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FOvmQoLkRCuk%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DOvmQoLkRCuk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FOvmQoLkRCuk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8ab9784872cde3e3207fb2491669940c/href">https://medium.com/media/8ab9784872cde3e3207fb2491669940c/href</a></iframe><p>A set in Python is an unordered collection of unique items. Sets are enclosed in curly braces {} or the set() function, and items in a set must be unique. Sets are often used to remove duplicates from a list or to perform mathematical set operations like union and intersection.</p><p><strong><em>Creating Python Sets</em></strong></p><p>Creating a set in Python is as simple as enclosing a comma-separated list of items in curly braces {} or using the set() function. Here is an example of creating a set:</p><pre># Creating a set with curly braces<br>my_set = {1, 2, 3, 4, 5}<br>print(my_set)<br><br># Creating a set with the set() function<br>my_set = set([1, 2, 3, 4, 5])<br>print(my_set)</pre><p><strong><em>Other Python Set Methods</em></strong></p><p>There are several built-in methods that can be used to perform operations on sets, such as adding or removing items, performing set operations, and others. Here are some examples of commonly used set methods:</p><ul><li>add() — adds an element to the set</li></ul><pre>my_set.add(6)<br>print(my_set)</pre><ul><li>remove() — removes an element from the set, raises an error if the element is not present</li></ul><pre>my_set.remove(6)<br>print(my_set)</pre><ul><li>union() — returns a set containing all items from both sets</li></ul><pre>set1 = {1, 2, 3}<br>set2 = {3, 4, 5}<br>set3 = set1.union(set2)<br>print(set3)</pre><ul><li>intersection() — returns a set containing only items that exist in both sets</li></ul><pre>set1 = {1, 2, 3}<br>set2 = {3, 4, 5}<br>set3 = set1.intersection(set2)<br>print(set3)</pre><ul><li>difference() — returns a set containing items that exist only in the first set, and not in the second set</li></ul><pre>set1 = {1, 2, 3}<br>set2 = {3, 4, 5}<br>set3 = set1.difference(set2)<br>print(set3)</pre><ul><li>clear() — removes all items from the set</li></ul><pre>my_set.clear()<br>print(my_set)</pre><p>In summary, sets are an extremely useful data structure in Python, allowing you to store unique items and perform set operations quickly and efficiently. The built-in set methods make it easy to add, remove, and manipulate items in a set.</p><h3><strong>21. Python Functions</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FEt9O9N6Tjdo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DEt9O9N6Tjdo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FEt9O9N6Tjdo%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/aaebefb3cb2baf35a04d318d2b1ef3d4/href">https://medium.com/media/aaebefb3cb2baf35a04d318d2b1ef3d4/href</a></iframe><p>Functions are a fundamental building block in Python, allowing you to group together a block of code and execute it multiple times. Functions can take in parameters, perform a set of operations, and return a value.</p><p><strong><em>Creating a Function</em></strong></p><pre>def my_function(param1, param2):<br>    # function code here<br>    return result</pre><p><strong><em>Calling a Function</em></strong></p><pre>result = my_function(arg1, arg2)</pre><p><strong><em>Arguments</em></strong></p><p>When calling a function, the values passed in are known as arguments. These values are passed to the function, where they can be used in the function’s code.</p><pre>def my_function(param1, param2):<br>    # function code here<br>    return result<br><br>result = my_function(arg1, arg2)</pre><p><strong><em>Parameters vs Arguments</em></strong></p><p>A function’s parameters are the variables defined in the function definition, while the arguments are the values passed in when the function is called.</p><p><strong><em>Arbitrary Arguments, *args</em></strong></p><p>In some cases, you may not know how many arguments a function will be passed. Python allows you to handle this situation using the *args syntax. *args allows you to pass a variable number of arguments to a function.</p><pre>def my_function(*args):<br>    for arg in args:<br>        print(arg)<br><br>my_function(1, 2, 3, 4, 5)</pre><p><strong><em>Keyword Arguments</em></strong></p><p>You can also pass arguments to a function using keyword arguments. This allows you to explicitly specify the parameter name for each argument.</p><pre>def my_function(param1, param2):<br>    print(param1, param2)<br><br>my_function(param2=2, param1=1)</pre><p><strong><em>Arbitrary Keyword Arguments, **kwargs</em></strong></p><p>Just like *args, Python also allows you to handle a variable number of keyword arguments using the **kwargs syntax.</p><pre>def my_function(**kwargs):<br>    for key, value in kwargs.items():<br>        print(key, value)<br><br>my_function(param1=1, param2=2, param3=3)</pre><p><strong><em>Default Parameter Value</em></strong></p><p>You can give a default value to a parameter in a function, if the caller of the function does not pass a value for that parameter, the default value will be used.</p><pre>def my_function(param1, param2 = &quot;default_value&quot;):<br>    print(param1, param2)<br><br>my_function(1)</pre><p>In summary, functions are a powerful feature in Python, allowing you to group together and reuse code. You can define functions with parameters and default values, and pass in arguments using various techniques such as *args and **kwargs. The ability to pass and handle variable numbers of arguments and keyword arguments can make your functions more flexible and useful.</p><p><strong><em>Recursion</em></strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F1iwq3XNLAlc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D1iwq3XNLAlc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F1iwq3XNLAlc%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/6402c7bef75103d28e910798c1c77209/href">https://medium.com/media/6402c7bef75103d28e910798c1c77209/href</a></iframe><p>Recursion is a technique in computer science where a function calls itself. It can be a powerful tool to solve problems and simplify code, but it’s important to use it judiciously, as it can also lead to infinite loops and stack overflow errors if not used correctly.</p><pre>def factorial(n):<br>    if n == 0:<br>        return 1<br>    else:<br>        return n * factorial(n-1)<br><br>print(factorial(5))</pre><p>In the above example, the function factorial is defined to take in an integer n, and it returns the factorial of that integer. The function calls itself with the argument n-1 until the base case (n==0) is reached, and then it returns the factorial.</p><p><strong><em>Python Lambda / Anonymous Function</em></strong></p><p>A lambda function is a small anonymous function, it can have any number of arguments but only one expression. The lambda function can be used wherever a function object is required.</p><pre>double = lambda x: x * 2<br>print(double(5))</pre><p>In the above example, we define a lambda function double, which takes in a single argument x and returns its value multiplied by 2.</p><p><strong><em>Why Use Lambda Functions?</em></strong></p><p>Lambda functions are useful in situations where you need a small function to be used only once. They are commonly used in places where a function is required as an argument, such as the sorted() and filter() built-in functions.</p><pre>numbers = [1, 2, 3, 4, 5, 6]<br>even_numbers = filter(lambda x: x % 2 == 0, numbers)<br>print(list(even_numbers))</pre><p>In this example, we use a lambda function to filter a list of numbers, returning only the even numbers.</p><p>Lambda functions are also useful when defining short, throwaway functions, such as when working with data inside list comprehensions.</p><pre>squared = [x**2 for x in range(5)]</pre><p>In this example, the lambda function is used to raise the number to the power of 2, it’s used only once and only for that list comprehension.</p><p>In conclusion, lambda functions can be useful in situations where you need a small, throwaway function, or when you need to pass a function as an argument to another function. They’re concise, easy to read and can make your code more readable and elegant.</p><h3><strong>22. Python Global, Local and Nonlocal variables</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F-t-6DyM-jsg%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D-t-6DyM-jsg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F-t-6DyM-jsg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e96b53c48197d79c5bdda1a22c5872b7/href">https://medium.com/media/e96b53c48197d79c5bdda1a22c5872b7/href</a></iframe><p>In Python, variables can be classified into three categories: global, local, and nonlocal. Understanding the differences between these types of variables is important for writing efficient and maintainable code.</p><p><strong><em>Global Variables</em></strong></p><p>A global variable is a variable that is defined outside of any function or class, and it can be accessed and modified from anywhere in the code. Global variables are typically used to store data that needs to be shared between different parts of the program.</p><pre>x = 5  # global variable<br><br>def my_function():<br>    print(x)  # can access x from within the function<br>my_function()</pre><p>In the above example, x is a global variable that is defined outside of any function. The function my_function can access and print the value of x.</p><p><strong><em>Local Variables</em></strong></p><p>A local variable is a variable that is defined within a function, and it can only be accessed within that function. Local variables are typically used to store temporary data that is only needed for the duration of the function call.</p><pre>def my_function():<br>    x = 5  # local variable<br>    print(x)<br><br>my_function()<br>print(x)  # will raise an error, x is not defined outside of the function</pre><p>In this example, x is a local variable that is defined within the function my_function. The function can access and print the value of x, but trying to access x outside of the function will raise an error.</p><p><strong><em>Nonlocal Variables</em></strong></p><p>A nonlocal variable is a variable that is defined in an outer scope, but is not global. Nonlocal variables are typically used when a function needs to modify a variable that is defined in an outer scope.</p><pre>x = 5  # global variable<br><br>def outer_function():<br>    x = 10  # nonlocal variable<br>    def inner_function():<br>        nonlocal x<br>        x += 5<br>        print(x)<br>    inner_function()</pre><pre>outer_function()<br>print(x)</pre><p>In this example, x is defined as a global variable with the value of 5. In the outer_function x is defined as a nonlocal variable with the value of 10, and inner_function modifies the value of x by adding 5. Finally, when we print x outside of the functions it will return the value of 15.</p><p>In conclusion, understanding the difference between global, local, and nonlocal variables is important for writing efficient and maintainable code. Knowing when to use each type of variable can help you write code that is easy to understand and debug.</p><h3><strong>23. Python Modules vs Package vs Libraries vs Frameworks</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FNNsEdxBw9l0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DNNsEdxBw9l0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FNNsEdxBw9l0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ed378bfbec12929db81850377052e318/href">https://medium.com/media/ed378bfbec12929db81850377052e318/href</a></iframe><p>When working with Python, it’s important to understand the differences between modules, packages, libraries, and frameworks. These concepts are closely related, but they have distinct characteristics that set them apart.</p><p><strong><em>Python Modules</em></strong></p><p>A Python module is a single file that contains Python code. This code can include variables, functions, and classes. Modules are used to organize and reuse code, making it easy to share functionality between different parts of your program.</p><pre># mymodule.py<br><br>def my_function():<br>    print(&quot;Hello, World!&quot;)</pre><pre>import mymodule<br><br>mymodule.my_function() # prints &quot;Hello, World!&quot;</pre><p>In this example, mymodule.py is a module that contains a single function called my_function. The import statement is used to make this function available in the current script. By importing mymodule, we are able to call my_function() and print &quot;Hello, World!&quot;.</p><p><strong><em>Python Package</em></strong></p><p>A Python package is a collection of modules that are organized in a directory hierarchy. Packages are used to organize related modules, making it easy to manage and share functionality.</p><pre>mypackage/<br>    __init__.py<br>    module1.py<br>    module2.py<br>    subpackage/<br>        __init__.py<br>        module3.py</pre><p>In this example, mypackage is a package that contains three modules: module1.py, module2.py, and module3.py which is in the subpackage. The __init__.py files are used to mark the directories as packages, and they can contain initialization code.</p><p><strong><em>Python Libraries</em></strong></p><p>A Python library is a collection of pre-written code that can be used to perform common tasks. Libraries are typically used to provide functionality that is not included in the Python standard library. For example, the NumPy library provides support for numerical computing, while the Pandas library provides support for data manipulation and analysis.</p><pre>import numpy as np<br><br>x = np.array([1, 2, 3])<br>print(x) # prints &quot;[1 2 3]&quot;</pre><p>In this example, we are using the NumPy library to create an array of numbers. The import statement is used to make the NumPy library available in the current script, and the as keyword is used to give the library a shorter name (np) for convenience.</p><p><strong><em>Python Frameworks</em></strong></p><p>A Python framework is a collection of libraries and modules that are organized in a specific way to provide a structure for building web applications. Frameworks provide a set of conventions and best practices for building web applications, making it easier to create consistent and maintainable code. Examples of popular Python web frameworks include Django and Flask.</p><pre>from flask import Flask<br><br>app = Flask(__name__)<br><br>@app.route(&#39;/&#39;)<br>def hello():<br>    return &#39;Hello, World!&#39;<br><br>if __name__ == &#39;__main__&#39;:<br>    app.run()</pre><p>In this example, we are using the Flask framework to build a simple web application. The Flask class is imported from the flask module, and an instance of the class is created. The route decorator is used to define a function that will handle requests to the root URL of the application.</p><p>In summary, modules, packages, libraries, and frameworks are all important concepts in Python programming. Modules are single files that contain Python code, packages are collections of modules organized in a directory hierarchy, libraries are pre-written code that can be used to perform common tasks, and frameworks are collections of libraries and modules that provide a structure for building web applications. Understanding the differences between these concepts can help you write more organized, maintainable, and reusable code in Python.</p><h3><strong>24. Python Objects and Classes</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FIo9ykoT_rhM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DIo9ykoT_rhM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FIo9ykoT_rhM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/fe3ea3f4f8f5865a7b608f9fa2f85830/href">https://medium.com/media/fe3ea3f4f8f5865a7b608f9fa2f85830/href</a></iframe><p>Python is an object-oriented programming language, which means that it allows developers to create and manipulate objects that have certain characteristics and behaviors. These characteristics and behaviors are defined by classes, which act as templates for creating objects.</p><p><strong><em>Creating a class</em></strong> in Python is done using the class keyword, followed by the name of the class and a colon. Within the class, you can define attributes (variables) and methods (functions) that will be available to all objects created from that class. For example:</p><pre>class Car:<br>    def __init__(self, make, model):<br>        self.make = make<br>        self.model = model<br>    <br>    def start(self):<br>        print(f&quot;The {self.make} {self.model} is starting.&quot;)</pre><p><strong><em>Creating an object</em></strong> from a class is called instantiation, and is done using the class name followed by parentheses. For example:</p><pre>my_car = Car(&quot;Toyota&quot;, &quot;Camry&quot;)</pre><p><strong><em>Class attributes</em></strong> are variables that are shared among all instances of a class, while instance attributes are specific to a single instance of a class. For example, in the Car class above, make and model are instance attributes, while the start method is an instance method.</p><p><strong><em>Constructors</em></strong> are special methods that are called when an object is created. The __init__ method is a constructor in Python.</p><p><strong><em>Deleting attributes</em></strong> or objects can be done using the del keyword. For example, if you want to delete the make attribute from the my_car object, you would use the following:</p><pre>del my_car.make</pre><p><strong><em>Instance Methods:</em></strong> In addition to instance methods, Python also supports class methods and static methods. A class method is a method that is bound to the class and not the instance of the object. It is defined using the @classmethod decorator. A static method is a method that belongs to a class rather than an instance of the class. It is defined using the @staticmethod decorator.</p><p>In summary, classes in Python allow developers to create objects with specific characteristics and behaviors. These objects can have attributes and methods that can be manipulated and used to perform tasks. Understanding the concepts of class attributes, instance attributes, constructors, and methods is crucial for effective object-oriented programming in Python.</p><p><strong>25. Object-oriented programming (OOP)</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fut2a6u9NDUA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dut2a6u9NDUA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fut2a6u9NDUA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/9e1299bedeaf52663142e981dbdf9e9c/href">https://medium.com/media/9e1299bedeaf52663142e981dbdf9e9c/href</a></iframe><p>Object-oriented programming (OOP) is a programming paradigm that is based on the concept of objects, which are instances of classes that have certain characteristics and behaviors. Python is a fully object-oriented programming language, which means that it supports all the major features of OOP, such as inheritance, polymorphism, encapsulation, and data abstraction.</p><p>In this blog post, we will be exploring the fundamentals of OOP in Python, and how to use these concepts in your own code. We’ll start by discussing what OOP is and the major benefits of using it, and then move on to the specific concepts of inheritance, polymorphism, encapsulation, and data abstraction.</p><p><strong><em>What is OOPS in Python?</em></strong></p><p>OOP is a programming paradigm that is based on the concept of objects, which are instances of classes that have certain characteristics and behaviors. In Python, classes are defined using the class keyword, and objects are created by calling the class like a function.</p><pre>class Dog:<br>    def __init__(self, name, breed):<br>        self.name = name<br>        self.breed = breed<br><br>dog1 = Dog(&quot;Fido&quot;, &quot;Golden Retriever&quot;)<br>print(dog1.name) # Output: &quot;Fido&quot;<br>print(dog1.breed) # Output: &quot;Golden Retriever&quot;</pre><p><strong><em>Some Major Benefits of OOPS Include</em></strong></p><ol><li>Reusability: Classes can be reused to create multiple objects, reducing the amount of code that needs to be written.</li><li>Modularity: Classes can be split into separate files, making it easier to manage and maintain large projects.</li><li>Abstraction: Classes can be used to hide the complexity of the underlying code, making it easier to understand and use.</li><li>Inheritance: Classes can be designed to inherit characteristics and behaviors from other classes, reducing the amount of code that needs to be written.</li><li>Polymorphism: Classes can be used to create objects with similar characteristics and behaviors, but with different implementations.</li></ol><p><strong><em>Difference Between Object Oriented &amp; Procedural Oriented Programming</em></strong></p><p>Object-oriented programming and procedural programming are two different programming paradigms. The main difference between them is that object-oriented programming is based on the concept of objects, while procedural programming is based on the concept of procedures.</p><p>OOP follows bottom-up approach, which means that it focuses on the objects and their interactions first, while procedural programming follows top-down approach, which means that it focuses on the overall problem first.</p><p><strong><em>Fundamentals of OOPS in Python</em></strong></p><p>Inheritance: Inheritance is the mechanism by which one class can inherit the characteristics and behaviors of another class. This allows you to create a new class that is a modified version of an existing class.</p><pre>class Animal:<br>    def __init__(self, name):<br>        self.name = name<br><br>class Dog(Animal):<br>    def __init__(self, name, breed):<br>        super().__init__(name)<br>        self.breed = breed<br>        <br>dog1 = Dog(&quot;Fido&quot;, &quot;Golden Retriever&quot;)<br>print(dog1.name) # Output: &quot;Fido&quot;<br>print(dog1.breed) # Output: &quot;Golden Retriever&quot;</pre><p><strong><em>Super() in Python</em></strong></p><p>The super() function is used to call a method from the parent class. This is often used in the constructor of a subclass to call the constructor of the parent class.</p><p><strong><em>Hybrid Inheritance: </em></strong>in Python Hybrid Inheritance is a combination of both single and multiple inheritance. It is a powerful feature of object-oriented programming (OOP) that allows a derived class to inherit from more than one base class. This is achieved by combining the properties of both single and multiple inheritance.</p><p>An example of hybrid inheritance in Python is shown below:</p><pre>class A:<br>    def displayA(self):<br>        print(&quot;This is class A&quot;)<br><br>class B:<br>    def displayB(self):<br>        print(&quot;This is class B&quot;)<br>class C(A, B):<br>    def displayC(self):<br>        print(&quot;This is class C&quot;)<br>c_obj = C()<br>c_obj.displayA()<br>c_obj.displayB()<br>c_obj.displayC()</pre><p>Output:</p><pre>This is class A<br>This is class B<br>This is class C</pre><p>In this example, class C is inheriting from both class A and class B. This allows it to access the methods and properties of both classes.</p><p><strong><em>Polymorphism</em></strong> in Python Polymorphism is a feature of OOP that allows objects of different classes to be treated as objects of a common base class. This means that a single method or operator can perform different actions depending on the type of object it is applied to.</p><p>An example of polymorphism in Python is shown below:</p><pre>class A:<br>    def display(self):<br>        print(&quot;This is class A&quot;)<br><br>class B:<br>    def display(self):<br>        print(&quot;This is class B&quot;)<br><br>a_obj = A()<br>b_obj = B()<br><br>for obj in (a_obj, b_obj):<br>    obj.display()</pre><p>Output:</p><pre>This is class A<br>This is class B</pre><p>In this example, both class A and class B have a method called “display”. When the for loop iterates through the objects, it calls the “display” method on each object. Since the “display” method is defined differently for each class, the output is different for each iteration.</p><p><strong><em>Polymorphism with Class Methods</em></strong> in Python Class methods are methods that are bound to a class and not the instance of the object. They can be called on the class itself, rather than an instance of the class.</p><p>An example of polymorphism with class methods in Python is shown below:</p><pre>class A:<br>    @classmethod<br>    def display(cls):<br>        print(f&quot;This is class {cls.__name__}&quot;)<br><br>class B:<br>    @classmethod<br>    def display(cls):<br>        print(f&quot;This is class {cls.__name__}&quot;)<br><br>A.display()<br>B.display()</pre><p>Output:</p><pre>This is class A<br>This is class B</pre><p>In this example, both class A and class B have a class method called “display”. When the class methods are called, it calls the “display” method on each class. Since the “display” method is defined differently for each class, the output is different for each class.</p><p><strong><em>Encapsulation</em></strong> in Python Encapsulation is a feature of object-oriented programming (OOP) that allows the implementation details of a class to be hidden from the outside world. This is achieved by using access modifiers, such as private and protected, to control access to the class’s methods and properties. Encapsulation ensures that the internal state of an object is protected from unauthorized access and modification.</p><p>An example of encapsulation in Python is shown below:</p><pre>class BankAccount:<br>    def __init__(self, balance):<br>        self.__balance = balance<br><br>    def get_balance(self):<br>        return self.__balance<br>    def set_balance(self, amount):<br>        if amount &lt; 0:<br>            print(&quot;Invalid amount&quot;)<br>        else:<br>            self.__balance = amount<br>account = BankAccount(1000)<br>print(account.get_balance())<br>account.set_balance(500)<br>print(account.get_balance())</pre><p>Output:</p><pre>1000<br>500</pre><p>In this example, the class BankAccount has a private variable called __balance, which is used to store the balance of the account. The get_balance and set_balance methods are used to access and modify the balance. The set_balance method also includes a validation check to ensure that the amount passed is not negative. By using encapsulation, we have protected the internal state of the object from unauthorized access and modification.</p><p><strong><em>Getters and Setters in Python</em></strong> Getters and setters are methods used to access and modify the values of private variables. These methods are used to implement encapsulation in OOP.</p><p>An example of getters and setters in Python is shown below:</p><pre>class Employee:<br>    def __init__(self, name, salary):<br>        self.__name = name<br>        self.__salary = salary<br><br>    def get_name(self):<br>        return self.__name<br>    def get_salary(self):<br>        return self.__salary<br>    def set_salary(self, amount):<br>        if amount &lt; 0:<br>            print(&quot;Invalid amount&quot;)<br>        else:<br>            self.__salary = amount<br><br>employee = Employee(&quot;John Doe&quot;, 5000)<br>print(employee.get_name())<br>print(employee.get_salary())<br>employee.set_salary(6000)<br>print(employee.get_salary())</pre><p>Output:</p><pre>John Doe<br>5000<br>6000</pre><p>In this example, the class Employee has a private variable called __name and __salary, which are used to store the name and salary of the employee. The get_name and get_salary methods are used to access the name and salary of the employee. The set_salary method is used to modify the salary of the employee. By using getters and setters, we have protected the internal state of the object from unauthorized access and modification.</p><p><strong><em>Access Modifiers in Python</em></strong> Access modifiers are used to control access to the methods and properties of a class. Python supports three types of access modifiers: public, private, and protected.</p><ul><li><strong><em>Public methods</em></strong> and properties can be accessed from anywhere.</li><li><strong><em>Private methods</em></strong> and properties can be accessed only within the class. They are denoted by a double underscore prefix (__).</li><li><strong><em>Protected methods</em></strong> and properties can be accessed within the class and its subclasses. They are denoted by a single underscore prefix (_).</li></ul><p>An example of using access modifiers (public, private, and protected) in Python is shown below:</p><pre>class MyClass:<br>    def __init__(self):<br>        self.public_var = &quot;I am a public variable&quot;<br>        self.__private_var = &quot;I am a private variable&quot;<br>        self._protected_var = &quot;I am a protected variable&quot;<br>        <br>    def public_method(self):<br>        print(&quot;I am a public method&quot;)<br>        <br>    def __private_method(self):<br>        print(&quot;I am a private method&quot;)<br>        <br>    def _protected_method(self):<br>        print(&quot;I am a protected method&quot;)<br><br>obj = MyClass()<br># Accessing public variable<br>print(obj.public_var) # Output: I am a public variable<br># Accessing private variable<br># This will raise an AttributeError<br>print(obj.__private_var)<br># Accessing protected variable<br>print(obj._protected_var) # Output: I am a protected variable<br># Accessing public method<br>obj.public_method() # Output: I am a public method<br># Accessing private method<br># This will raise an AttributeError<br>obj.__private_method()<br># Accessing protected method<br>obj._protected_method() # Output: I am a protected method</pre><p>In this example, the class MyClass has public, private and protected variables and methods. Public variables and methods can be accessed from anywhere, private variables and methods can only be accessed within the class and protected variables and methods can be accessed within the class and its subclasses.</p><p>It’s worth noting that, in python, the naming convention of using double underscore prefix (__) is used to indicate to the developer that the variable/method is intended to be private but it doesn’t make it truly private, it’s just a naming convention and can be accessed using the _classname__variablename.</p><p><strong><em>Data abstraction</em></strong> is a concept in object-oriented programming that refers to the practice of hiding the implementation details of a class from the user and only exposing the necessary information. The idea is to create a simplified version of the class that is easy to understand and use. This is accomplished by using abstract classes and interfaces.</p><p>For example, consider a class that represents a bank account. The user does not need to know the details of how the account balance is stored or how transactions are processed. Instead, the user only needs to know how to deposit money, withdraw money, and check the balance. These methods can be made available to the user while the implementation details of the class are hidden.</p><pre>class BankAccount:<br>    def __init__(self, balance):<br>        self.__balance = balance<br><br>    def deposit(self, amount):<br>        self.__balance += amount<br>    <br>    def withdraw(self, amount):<br>        if self.__balance &gt;= amount:<br>            self.__balance -= amount<br>        else:<br>            print(&quot;Insufficient funds&quot;)<br>    <br>    def check_balance(self):<br>        return self.__balance</pre><p>In this example, the implementation details of the class BankAccount such as the variable __balance is hidden from the user and the user can only access the methods deposit(), withdraw() and check_balance() which expose only the necessary information to the user.</p><p><strong><em>Advantages of OOPS in Python:</em></strong></p><ul><li>OOP in Python allows for the creation of reusable and modular code.</li><li>OOP allows for the encapsulation of data, making it easier to protect the data from outside access and modification.</li><li>OOP allows for the creation of complex and large software systems in a manageable way.</li><li>OOP in Python allows for easy and efficient code maintenance.</li><li>OOP allows for the creation of real-world models in code, making it easier to understand and relate to the problem being solved.</li><li>The use of inheritance and polymorphism in OOP allows for code to be reused and extended in a logical way.</li><li>OOP allows for the design of code that is easy to test and debug.</li></ul><p>Overall, OOP in Python provides a powerful and flexible approach to software development that allows for the creation of efficient, reusable, and maintainable code.</p><h3><strong>26. Python Exception Handling</strong></h3><p>Python exception handling is a mechanism to handle run-time errors that occur during the execution of a program. Exception handling allows the program to continue to run even if an error occurs, instead of abruptly halting and exiting.</p><p>The basic syntax of exception handling in Python is the try-except block. The code that could potentially raise an exception is placed in the try block, and the code to handle the exception is placed in the except block. The finally block, if present, is executed regardless of whether an exception occurred.</p><pre>try:<br>    # code that could raise an exception<br>    x = 5 / 0<br>except ZeroDivisionError:<br>    # code to handle the exception<br>    print(&quot;division by zero!&quot;)</pre><p>In this example, the try block contains the code that raises an exception (division by zero), and the except block contains the code to handle the exception (printing an error message).</p><p>You can also catch multiple exception in a single except block by providing a tuple of exception types.</p><pre>try:<br>    # code that could raise an exception<br>    x = int(&quot;abc&quot;)<br>except (ZeroDivisionError, ValueError):<br>    # code to handle the exception<br>    print(&quot;division by zero or invalid input!&quot;)</pre><p>You can also use the try-with-else clause. The else block will be executed if no exception is raised in the try block.</p><pre>try:<br>    # code that could raise an exception<br>    x = 5 / 2<br>except ZeroDivisionError:<br>    # code to handle the exception<br>    print(&quot;division by zero!&quot;)<br>else:<br>    print(&quot;no exception occured&quot;)</pre><p>Catching exceptions in Python can help you handle run-time errors in your code, allowing your program to continue running even if an error occurs. Try-except blocks, multiple exception handling and try-with-else clauses provide flexibility and control over how your program responds to exceptions, making it easier to write robust and reliable code.</p><h3><strong>27. Python Custom Exceptions</strong></h3><p>Customizing exception classes in Python allows you to create your own exception types that can be used to handle specific errors in your code. This allows for more fine-grained control over how your program responds to exceptions, and makes it easier to understand the cause of an error.</p><p>To create a custom exception class, you need to create a new class that inherits from the built-in Exception class. You can then add any additional methods or properties that you need.</p><pre>class MyException(Exception):<br>    def __init__(self, message):<br>        self.message = message<br><br>try:<br>    raise MyException(&quot;An error has occurred.&quot;)<br>except MyException as e:<br>    print(e.message)</pre><p>In this example, we have created a custom exception class MyException that takes a message as an argument. We raise an instance of this exception in the try block, and catch it in the except block. The message property of the exception can then be accessed and printed.</p><p>You can also customize the behavior of your exception class by overloading the built-in methods of the Exception class, such as the __str__ method, which is used to return a string representation of the exception.</p><pre>class MyException(Exception):<br>    def __init__(self, message):<br>        self.message = message<br>        <br>    def __str__(self):<br>        return self.message<br><br>try:<br>    raise MyException(&quot;An error has occurred.&quot;)<br>except MyException as e:<br>    print(e)</pre><p>In this example, the __str__ method is overloaded and returns the message property of the exception, so when we print the exception object, it will print the message,</p><p>Customizing exception classes in Python allows you to create specific exception types that are tailored to the needs of your program. This can make it easier to understand the cause of an error, and provide more control over how your program responds to exceptions.</p><h3><strong>28. File Handling in Python</strong></h3><p>File handling is an important aspect of programming and is a common task for developers. Python provides several built-in functions and classes for handling files and directories. In this blog post, we will discuss the basics of file handling in Python and provide an example of how to read and write to a file.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FzV8Rp4je0QQ%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DzV8Rp4je0QQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FzV8Rp4je0QQ%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/dff369ef8fe9c03563896ce24dce7d5a/href">https://medium.com/media/dff369ef8fe9c03563896ce24dce7d5a/href</a></iframe><p>The first step in file handling is to open a file. The built-in open() function is used for this purpose. The function takes two arguments: the file name and the mode in which the file should be opened. The mode can be &#39;r&#39; for reading, &#39;w&#39; for writing, &#39;a&#39; for appending, and &#39;b&#39; for binary mode.</p><pre># Open a file for reading<br>file = open(&quot;example.txt&quot;, &quot;r&quot;)</pre><p>Once the file is open, you can read its contents using the read() function. This function takes an optional argument that specifies the number of bytes to be read. If no argument is provided, the entire file will be read.</p><pre># Read the entire file<br>file_contents = file.read()<br>print(file_contents)</pre><p>You can also read the file line by line using the readline() function. This function reads a single line from the file and returns it as a string. To read all the lines in the file, you can use a for loop.</p><pre># Read the file line by line<br>for line in file:<br>    print(line)</pre><p>To write to a file, you need to open the file in write mode. The write() function is used to write to the file.</p><pre># Open a file for writing<br>file = open(&quot;example.txt&quot;, &quot;w&quot;)<br>file.write(&quot;Hello, world!&quot;)</pre><p>When you are done with the file, it is important to close it. This can be done using the close() function.</p><pre># Close the file<br>file.close()</pre><p>Another way to handle file is using with open statement. It is a good practice to use it as it automatically handles the closing of file after the block is executed.</p><pre>with open(&quot;example.txt&quot;, &quot;r&quot;) as file:<br>    file_contents = file.read()<br>    print(file_contents)</pre><p>In this way, you don’t have to explicitly close the file as it automatically closed after the block is executed.</p><p>In conclusion, file handling in Python is simple and easy to use. The built-in open() function and related functions make it easy to read from and write to files. By using the with open statement, you can ensure that your files are properly closed and resources are freed up when you are done with them.</p><h3><strong>29. Python Iterators</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FdJd5ie6YccQ%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdJd5ie6YccQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FdJd5ie6YccQ%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f03057ce2d2e578ca2dce28d80381bf0/href">https://medium.com/media/f03057ce2d2e578ca2dce28d80381bf0/href</a></iframe><p>Iterators are objects that can be iterated (looped) upon. They represent a stream of data. In Python, an iterator is an object that implements two methods, iter() and next().</p><p>The iter() method returns the iterator object itself. The next() method returns the next value from the iterator. If there are no more items to return, it should raise StopIteration.</p><p>Here is an example of creating an iterator in Python:</p><pre>class MyIterator:<br>    def __init__(self, start, end):<br>        self.start = start<br>        self.end = end<br><br>    def __iter__(self):<br>        return self<br>    def __next__(self):<br>        if self.start &gt;= self.end:<br>            raise StopIteration<br>        current = self.start<br>        self.start += 1<br>        return current<br>it = MyIterator(1, 10)<br>for i in it:<br>    print(i)</pre><h3><strong>30. Python Generators</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FidtX9FIg06M%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DidtX9FIg06M&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FidtX9FIg06M%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/6fa53fbfb811db463ce4193848a3abd8/href">https://medium.com/media/6fa53fbfb811db463ce4193848a3abd8/href</a></iframe><p>A generator is a special type of iterator, which is a simpler and more memory-efficient way of creating iterators. A generator is defined as a function that uses the yield statement to return a value, rather than returning the value directly. When the generator function is called, it returns a generator object, but it does not start executing the function. The execution starts only when the next() method is called on the generator object.</p><p>Here is an example of a generator function in Python:</p><pre>def my_range(start, end):<br>    current = start<br>    while current &lt; end:<br>        yield current<br>        current += 1<br><br>gen = my_range(1, 10)<br>for i in gen:<br>    print(i)</pre><h3><strong>31. Python Closures</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FjOiNdIwLfys%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DjOiNdIwLfys&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FjOiNdIwLfys%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/3792f3299e32d5dd5e4dc9aac749affd/href">https://medium.com/media/3792f3299e32d5dd5e4dc9aac749affd/href</a></iframe><p>A closure is a function object that remembers values in the enclosing scope even if they are not present in memory. It is a record that stores a function together with an environment: a mapping associating each free variable of the function (variables that are used locally, but defined in an enclosing scope) with the value or reference to which the name was bound when the closure was created.</p><p>Here is an example of a closure in Python:</p><pre>def outer_function(x):<br>    def inner_function(y):<br>        return x + y<br>    return inner_function<br><br>closure = outer_function(10)<br>print(closure(5))  # Output: 15</pre><h3><strong>32. Python Decorator</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FeacAyB96cx0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DeacAyB96cx0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FeacAyB96cx0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5f555340d2e45b7ddf4b0ca5624d7dfa/href">https://medium.com/media/5f555340d2e45b7ddf4b0ca5624d7dfa/href</a></iframe><p>A decorator is a design pattern in Python that allows a user to add new functionality to an existing object without modifying its structure. Decorators are usually called before the definition of a function you want to decorate. Decorators are defined as a callable function that takes a function as an argument and returns a new function.</p><p>Here is an example of a decorator in Python:</p><pre>def my_decorator(func):<br>    def wrapper():<br>        print(&quot;Something is happening before the function is called.&quot;)<br>        func()<br>        print(&quot;Something is happening after the function is called.&quot;)<br>    return wrapper<br><br>def say_whee():<br>    print(&quot;Whee!&quot;)<br>say_whee = my_decorator(say_whee)<br>say_whee()</pre><p>Python programming provides us with a built-in @property decorator which makes usage of getter and setters much easier in Object-Oriented Programming.</p><p><strong><em>Class Without Getters and Setters</em></strong></p><pre># Class Without Getters and Setters<br><br>class Celsius:<br><br>    def __init__(self, temperature=0):<br>        self.temperature = temperature<br><br>    def to_fahrenheit(self):<br>        return (self.temperature * 1.8) + 32<br><br><br># Create a new object<br>human = Celsius()<br># Set the temperature<br>human.temperature = 37<br># Get the temperature attribute<br>print(human.temperature)<br># Get the to_fahrenheit method<br>print(human.to_fahrenheit())</pre><p>Output-</p><pre>37<br>98.60000000000001</pre><p><strong><em>Using Getters and Setters</em></strong></p><pre># Making Getters and Setter methods<br>class Celsius:<br>    def __init__(self, temperature=0):<br>        self.set_temperature(temperature)<br><br>    def to_fahrenheit(self):<br>        return (self.get_temperature() * 1.8) + 32<br><br>    # getter method<br>    def get_temperature(self):<br>        return self._temperature<br><br>    # setter method<br>    def set_temperature(self, value):<br>        if value &lt; -273.15:<br>            raise ValueError(&quot;Temperature below -273.15 is not possible.&quot;)<br>        self._temperature = value<br><br><br># Create a new object, set_temperature() internally called by __init__<br>human = Celsius(37)<br><br># Get the temperature attribute via a getter<br>print(human.get_temperature())<br><br># Get the to_fahrenheit method, get_temperature() called by the method itself<br>print(human.to_fahrenheit())<br><br># new constraint implementation<br>human.set_temperature(-300)<br><br># Get the to_fahreheit method<br>print(human.to_fahrenheit())</pre><p>Output-</p><pre>Traceback (most recent call last):<br>File &quot;D:\Projects\tutorial\welcome\__init__.py&quot;, line 30, in &lt;module&gt;<br>  human.set_temperature(-300)<br>File &quot;D:\Projects\tutorial\welcome\__init__.py&quot;, line 16, in set_temperature<br>  raise ValueError(&quot;Temperature below -273.15 is not possible.&quot;)<br>ValueError: Temperature below -273.15 is not possible.<br>37<br>98.60000000000001</pre><h3><strong>33. The property Class</strong></h3><p>Python’s property() is the Pythonic way to avoid formal getter and setter methods in your code. This function allows you to turn class attributes into properties or managed attributes. Since property() is a built-in function, you can use it without importing anything.</p><p>Example-</p><pre># using property class<br>class Celsius:<br>    def __init__(self, temperature=0):<br>        self.temperature = temperature<br><br>    def to_fahrenheit(self):<br>        return (self.temperature * 1.8) + 32<br><br>    # getter<br>    def get_temperature(self):<br>        print(&quot;Getting value...&quot;)<br>        return self._temperature<br><br>    # setter<br>    def set_temperature(self, value):<br>        print(&quot;Setting value...&quot;)<br>        if value &lt; -273.15:<br>            raise ValueError(&quot;Temperature below -273.15 is not possible&quot;)<br>        self._temperature = value<br><br>    # creating a property object<br>    temperature = property(get_temperature, set_temperature)<br><br>human = Celsius(37)<br>print(human.temperature)<br>print(human.to_fahrenheit())<br>human.temperature = -300</pre><p>Output-</p><pre>Traceback (most recent call last):<br>  File &quot;D:\Projects\tutorial\welcome\__init__.py&quot;, line 30, in &lt;module&gt;<br>    human.set_temperature(-300)<br>  File &quot;D:\Projects\tutorial\welcome\__init__.py&quot;, line 16, in set_temperature<br>    raise ValueError(&quot;Temperature below -273.15 is not possible.&quot;)<br>ValueError: Temperature below -273.15 is not possible.<br>37<br>98.60000000000001</pre><h3><strong>34. Python datetime Module</strong></h3><p>Python’s datetime module provides a set of classes for manipulating dates and times. These classes include date, time, datetime, timedelta, and tzinfo, each of which offers a different level of date and time information.</p><p>Here is an example of using the datetime class to create a date object representing today&#39;s date:</p><pre>from datetime import datetime<br><br>today = datetime.now()<br>print(today)</pre><p>This will output something like:</p><pre>2022-10-28 12:34:56.789012</pre><p>You can also create a datetime object by specifying the year, month, and day:</p><pre>birthday = datetime(1997, 7, 15)<br>print(birthday)</pre><p>This will output:</p><pre>1997-07-15 00:00:00</pre><p>The datetime class also includes methods for working with dates and times. For example, you can use the strftime() method to format a datetime object as a string:</p><pre>formatted_birthday = birthday.strftime(&quot;%B %d, %Y&quot;)<br>print(formatted_birthday)</pre><p>This will output:</p><pre>July 15, 1997</pre><p>The timedelta class is used to represent a duration of time, and can be used to perform arithmetic with datetime objects:</p><pre>from datetime import timedelta<br><br>ten_days_later = today + timedelta(days=10)<br>print(ten_days_later)</pre><p>This will output something like:</p><pre>2022-11-07 12:34:56.789012</pre><p>The datetime module also includes support for time zones through the pytz library, which can be used to create tzinfo objects for different time zones.</p><p>More Examples-</p><pre>import datetime<br>from datetime import time<br><br># date and time<br>datetime_object = datetime.datetime.now()<br>print(datetime_object)<br><br># today’s date<br>date_object = datetime.date.today()<br>print(date_object)<br><br># create custom date<br>d = datetime.date(2019, 4, 13)<br>print(d)<br><br><br># date object of today&#39;s date<br>today = datetime.date.today() <br>print(&quot;Current year:&quot;, today.year)<br>print(&quot;Current month:&quot;, today.month)<br>print(&quot;Current day:&quot;, today.day)<br><br># time(hour = 0, minute = 0, second = 0)<br>a = time()<br>print(&quot;a =&quot;, a)<br><br># time(hour, minute and second)<br>b = time(11, 34, 56)<br>print(&quot;b =&quot;, b)<br><br># time(hour, minute and second)<br>c = time(hour = 11, minute = 34, second = 56)<br>print(&quot;c =&quot;, c)<br><br># time(hour, minute, second, microsecond)<br>d = time(11, 34, 56, 234566)<br>print(&quot;d =&quot;, d)</pre><p>Output-</p><pre>2022-11-04 13:14:15.291401<br>2022-11-04<br>2019-04-13<br>Current year: 2022<br>Current month: 11<br>Current day: 4<br>a = 00:00:00<br>b = 11:34:56<br>c = 11:34:56<br>d = 11:34:56.234566</pre><p>In summary, the datetime module provides a powerful set of classes for working with dates and times in Python. Whether you need to create date objects, perform arithmetic with dates, or format dates as strings, the datetime module has you covered.</p><h3><strong>35. What Next?</strong></h3><p>Now you know basic and advance concept of python. Now, I would like to recommended you please follow below suggestion-</p><p>Create programs for each and every topic till now.<br>Solve some of the interview programs, you can get basic / advance question from websites like hacker rank, geeks for geeks etc.</p><p><strong><em>What should I learn next?<br></em></strong>Now, you need to decide what you want to do next. You need to figure out what you want to become in your life, accordingly you can choose Python framework.</p><p><strong><em>Read some cool stuff-<br></em></strong><a href="https://medium.com/@dipeshpal17/">https://medium.com/@dipeshpal17/</a></p><p><strong><em>You must learn atleast on Database Management Software &amp; Tools-<br>Relational databases any one of them-</em></strong></p><ul><li>PostgreSQL</li><li>MySQL</li><li>SQLite</li></ul><p><strong>If you want to be Machine Learning / Data Scientist / AI-ML Engineer-</strong></p><ul><li>Python</li><li>Machine Learning Course Theory (<a href="https://www.coursera.org/learn/machine-learning">https://www.coursera.org/learn/machine-learning</a>)</li><li>Machine Learning Frameworks</li><li>Numpy</li><li>Pandas</li><li>scikit-learn</li><li>Tensorflow Keras</li><li>Transformers</li><li>NLTK</li><li>Spacy</li><li>Learn Matplotlib</li><li>Build Project with your own ideas</li><li>Keep Learning</li></ul><p><strong>If you want to be fullstack python developer-</strong></p><ul><li>Web Frameworks</li><li>FastAPI / Django / Flask</li><li>Jinja2</li><li>HTML</li><li>CSS and Bootstrap</li><li>Responsive Design</li><li>Task queues</li><li>Celery</li><li>Redis Queue (RQ)</li><li>Networking</li><li>HTTPS</li><li>WebSockets</li><li>WebRTC</li><li>Web APIs</li><li>Microservices</li><li>Webhooks</li><li>Bots</li><li>API integration</li><li>Twilio</li><li>Stripe</li><li>Keep Learning</li></ul><h3><strong>36. About Author</strong></h3><p>Data Scientist with 4 years of experience in building data-intensive applications, overcoming complex architectural, and scalability issues in diverse industries. Proficient in predictive modeling, data processing, as well as scripting languages, including Python. Capable of creating, developing, testing, and deploying highly adaptive diverse services to translate business and functional qualifications into substantial deliverables.</p><p><strong>You can read more about me here: </strong><a href="http://dipeshpal.in/"><strong>http://dipeshpal.in</strong></a></p><p><strong>Thanks me: </strong><a href="https://www.youtube.com/techportofficial"><strong>https://www.youtube.com/techportofficial</strong></a></p><p><strong>Buy me a coffee: </strong><a href="https://www.buymeacoffee.com/dipeshpal"><strong>https://www.buymeacoffee.com/dipeshpal</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_XQPA395LDmSLKM1" /></figure><p><strong><em>Contact-</em></strong></p><ol><li><a href="/service/mailto:dipeshpal17@gmail.com"><strong>dipeshpal17@gmail.com</strong></a></li><li><a href="https://www.instagram.com/dipesh_pal17"><strong>https://www.instagram.com/dipesh_pal17</strong></a></li><li><a href="https://www.youtube.com/techportofficial"><strong>https://www.youtube.com/techportofficial</strong></a></li><li><a href="https://www.linkedin.com/in/dipesh-paul"><strong>https://www.linkedin.com/in/dipesh-paul</strong></a></li><li><a href="https://twitter.com/Dipesh17pal"><strong>https://twitter.com/Dipesh17pal</strong></a></li><li><a href="https://github.com/Dipeshpal"><strong>https://github.com/Dipeshpal</strong></a></li><li><a href="https://pypi.org/user/dipeshpal"><strong>https://pypi.org/user/dipeshpal</strong></a></li><li><a href="http://dipeshpal.in/"><strong>http://dipeshpal.in</strong></a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5562e93cf49e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Are you looking for the best gaming laptop between Rs.40K]]></title>
            <link>https://dipeshpal17.medium.com/are-you-looking-for-the-best-gaming-laptop-between-rs-40k-ba13eb3c3fe0?source=rss-f438a2ca19ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba13eb3c3fe0</guid>
            <category><![CDATA[big-billion-day]]></category>
            <category><![CDATA[best-gaming-laptops-2022]]></category>
            <category><![CDATA[best-gaming-laptop]]></category>
            <category><![CDATA[laptop]]></category>
            <category><![CDATA[best-offers]]></category>
            <dc:creator><![CDATA[Dipesh Pal]]></dc:creator>
            <pubDate>Mon, 26 Sep 2022 07:43:25 GMT</pubDate>
            <atom:updated>2022-09-26T07:43:25.623Z</atom:updated>
            <content:encoded><![CDATA[<p>Are you looking for the best gaming laptop between Rs.40K and Rs.70K during Big Billion Days Sale on Flipkart? Are you stuck in the middle of your budget, trying to find the right laptop that can run all your favorite games, but is still affordable? Well, look no more because this post will help you get an idea about which gaming laptops are worth buying within that price range.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TCCstKwOQXnediysVq7Ppw.jpeg" /><figcaption>BBD SALE LAPTOPS</figcaption></figure><blockquote>Watch Video on YouTube-</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FZPolGXZG-Rg%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DZPolGXZG-Rg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FZPolGXZG-Rg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2f9fa0a624f6a826fa115c3f39226482/href">https://medium.com/media/2f9fa0a624f6a826fa115c3f39226482/href</a></iframe><p><strong>Below are the links to the best laptop for gaming-</strong></p><p>HP Victus Core i5 12th Gen ₹59,890: <a href="http://fkrt.it/61UdLkNNNN">http://fkrt.it/61UdLkNNNN</a></p><p>MSI Core i5 11th Gen ₹60,990: <a href="http://fkrt.it/oGoE5UuuuN">http://fkrt.it/oGoE5UuuuN</a></p><p>Lenovo Ideapad Gaming ₹59,990: <a href="http://fkrt.it/61c81iNNNN">http://fkrt.it/61c81iNNNN</a></p><p>Lenovo IdeaPad Gaming ₹64,890: <a href="http://fkrt.it/61O4S1NNNN">http://fkrt.it/61O4S1NNNN</a></p><p>Acer Aspire 7 ₹61,990: <a href="http://fkrt.it/61XA81NNNN">http://fkrt.it/61XA81NNNN</a></p><p>ASUS TUF Gaming A17 ₹67,890: <a href="http://fkrt.it/61Qjy1NNNN">http://fkrt.it/61Qjy1NNNN</a></p><p>MSI Bravo 15 ₹49,890: <a href="http://fkrt.it/oGdUBpuuuN">http://fkrt.it/oGdUBpuuuN</a></p><p>Lenovo IdeaPad Gaming 3 ₹46,990: <a href="http://fkrt.it/oGUs8ruuuN">http://fkrt.it/oGUs8ruuuN</a></p><p>Acer Aspire 7 ₹51,890: <a href="http://fkrt.it/oGgNXUuuuN">http://fkrt.it/oGgNXUuuuN</a></p><p>ASUS TUF Gaming F15 ₹47,890: <a href="http://fkrt.it/617GBANNNN">http://fkrt.it/617GBANNNN</a></p><p>HP Pavilion ₹49,890: <a href="http://fkrt.it/oGJfVUuuuN">http://fkrt.it/oGJfVUuuuN</a></p><h4>Stay Connected with me-</h4><p>🔗 Website 1- <a href="https://www.dipeshpal.com/">https://www.dipeshpal.com</a></p><p>🔗 Website 2- <a href="https://thetechport.in/">https://thetechport.in</a></p><p>🔗 About: <a href="https://www.dipeshpal.in/">https://www.dipeshpal.in</a></p><p>🔗 Google+ — <a href="https://plus.google.com/u/0/+DipeshPal17/posts">https://plus.google.com/u/0/+DipeshPal17/posts</a></p><p>🔗 Instagram- <a href="https://www.instagram.com/dipesh_pal17">https://www.instagram.com/dipesh_pal17</a></p><p>🔗 Instagram Page- <a href="https://instagram.com/techportofficial">https://instagram.com/techportofficial</a></p><p>🔗 Twitter- <a href="https://twitter.com/Dipesh17pal">https://twitter.com/Dipesh17pal</a></p><p>🔗 Facebook Page- <a href="https://www.facebook.com/dipeshpal17/">https://www.facebook.com/dipeshpal17/</a></p><p>🔗 Linkedin- <a href="https://www.linkedin.com/in/dipesh-pal-a34952110/">https://www.linkedin.com/in/dipesh-pal-a34952110/</a></p><p>🔗 Buy me a coffee: <a href="https://www.buymeacoffee.com/dipeshpal">https://www.buymeacoffee.com/dipeshpal</a></p><p>Gaming laptops are one of the most highly sought-after products due to their high performance, good looks, and long battery backup. To help you with your research we have made a list of laptops that have been put through extensive testing and meet the various requirements of a gaming laptop such as high-end graphics, better audio, and portability.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba13eb3c3fe0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create an AI-based Intelligent Virtual Assistant in 4 lines of Python (JarvisAI-4.0)]]></title>
            <link>https://medium.com/analytics-vidhya/create-an-ai-based-intelligent-virtual-assistant-in-4-lines-of-python-jarvisai-4-0-1a5c4f031a1e?source=rss-f438a2ca19ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a5c4f031a1e</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[virtual-assistant]]></category>
            <dc:creator><![CDATA[Dipesh Pal]]></dc:creator>
            <pubDate>Mon, 11 Jul 2022 09:45:11 GMT</pubDate>
            <atom:updated>2022-07-15T10:27:11.833Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>A virtual assistant, also called an AI assistant or digital assistant, is an application program that understands natural language voice commands and completes tasks for the user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UIILEPgRmVTlANwPj_47mA.png" /><figcaption>JarvisAI Tutorial</figcaption></figure><h3>Content-</h3><ol><li>What we are building</li><li>Code and Explanation</li><li>Add your own functionality</li><li>Architecture</li><li>GitHub Repository</li><li>How you can contribute</li><li>References</li><li>How to stay updated about new builds and release</li></ol><h3>1. What we are building-</h3><p><strong>Our virtual assistant will be able to do the followings things-</strong></p><p>( Supported Commands JarvisAI==4.0, the new version might have more features)</p><p>1. you can ask the date: Say- “what is the date today” <br> 2. you can ask the time: Say- “what is the time now” <br> 3. you can ask joke: Say- “tell me a joke” <br> 4. you can ask for news: Say- “tell me the news” <br> 5. you can ask weather: Say- “what is the weather”, “tell me the weather”, “tell me about the weather”, “tell me about the weather in &lt; city&gt;” <br> 6. you can ask about: Say- “tell me about &lt; topic&gt;” <br> 7. you can open website: Say- “open website &lt; website name&gt;”, “open website &lt; website name&gt;&lt;.extension&gt;”, “open website techport.in” <br> 8. you can play on youtube: Say- “play on youtube &lt; video name&gt;”, “play &lt; video name&gt; on youtube” <br> 9. you can send a WhatsApp message: Say- “send WhatsApp message’’ <br> 10. you can send an email: Say- “send email” <br> 11. greet: Say- “greet”, “hello”, “hey”, “hi”, “good morning”, “good afternoon”, “good evening” <br> 12. goodbye: Say- “goodbye”, “bye”, “see you later” <br> 13. conversation: Say- “conversation”, “chat”, “talk”, “talk with chatbot” <br> 14. you can take a screenshot of the current screen: Say- “take screenshot” <br> 15. you can click a photo: Say- “click photo” <br> 16. you can check internet speed: Say- “check internet speed” <br> 17. you can download a youtube video: Say- “download youtube video” <br> 18. you can check covid cases: Say- “covid cases in &lt; country&gt;”, “covid cases &lt; country&gt;” <br> 19. you can ask to play games: Say- “play games”’</p><h3>2. Code and Explanation-</h3><h4><strong>Video Tutorial-</strong></h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F6p8bhNGtVbA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D6p8bhNGtVbA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F6p8bhNGtVbA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f3a191cc7b8b3872b55db35146120c0d/href">https://medium.com/media/f3a191cc7b8b3872b55db35146120c0d/href</a></iframe><p>So let’s create our own virtual assistant.</p><p><strong><em>Notes-</em></strong></p><ul><li>All the codes are available on my GitHub.</li><li>Demo YouTube video and code YouTube video is also available on my channel.</li><li>Required links and packages are mentioned below.</li><li>Sharing and <a href="https://www.youtube.com/dipeshpal17">Subscribe me on YouTube</a> would be appreciated.</li><li>The code and functions may be updated in the future so stay tuned with me on <a href="https://www.youtube.com/dipeshpal17">YouTube</a> and this project&#39;s <a href="https://pypi.org/project/JarvisAI/">official page</a>.</li></ul><p><strong><em>Lets code-</em></strong></p><h4>2.1. Required packages and libraries-</h4><p><a href="https://pypi.org/project/JarvisAI/">https://pypi.org/project/JarvisAI</a></p><pre>pip install JarvisAI==4.0</pre><p>OR</p><pre>pip install JarvisAI</pre><p>This is the latest virtual assistant module, created by me. It provides the basic functionality of any virtual assistant. The prerequisite is only Python (&gt; 3.6).</p><h4>2.2. Get your free API Key-</h4><p>Signup and get your free API key: <a href="http://jarvis-ai-api.herokuapp.com/">http://jarvis-ai-api.herokuapp.com</a></p><p>You need an API key because JarvisAI process all heavy tasks on its server so that you no need to run heavy NPL, AI-ML tasks on your laptop or machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gThCdTKbXfBSZ-Is6reCSQ.png" /></figure><h4>2.3. Code-</h4><p>After installing the library you can import the module-</p><p><strong>Code all you need-</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/da6872bb5169007258decbbb6e8e0309/href">https://medium.com/media/da6872bb5169007258decbbb6e8e0309/href</a></iframe><p><strong>Complete Code (Advance Usage)-</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ff0e5af70caaa33773a3ff57f67bd276/href">https://medium.com/media/ff0e5af70caaa33773a3ff57f67bd276/href</a></iframe><h4>2.4. Run the program-</h4><p>It will start your AI, it will ask you to give input and accordingly, it will produce output.</p><p>You can configure the `input_mechanism` and `output_mechanism` parameters for voice input/output or text input/output.</p><h4>2.5. Let’s understand the Parameters-</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0b457f329ef256dd6438d01a83880ef7/href">https://medium.com/media/0b457f329ef256dd6438d01a83880ef7/href</a></iframe><h3>3. Add your own functionality</h3><p>You can write any function you want, there are few rules-</p><ol><li>The function must contain the parameter ‘feature_command’ which is the command you want to execute Return is optional</li><li>If you want to provide a return value it should only return text (str)</li><li>Your return value will be displayed or called out by the choice of OutputMethods of JarvisAI.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JqSmBG9NTQNSQzpxdC36BA.png" /></figure><p>4. Then register your feature like this-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zaKIncVOQWuqmXvOr34WsA.png" /></figure><p>That’s it now call ‘obj.start()’ to start your AI, and enjoy.</p><h3>4. Architecture</h3><p>The JarvisAI’s architecture is divided into two parts.</p><ol><li><strong>User End-</strong> It is basically responsible for getting input from the user and after preprocessing input it sends input to JarvisAI’s server. And once the server sends its response back, it produces output on the user screen/system.</li><li><strong>Server Side-</strong> The server is responsible to handle various kinds of AI-ML, and NLP tasks. It mainly identifies user intent by analyzing user input and interacting with other external APIs and handling user input.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_PK8b96tBgRHlmZecli-nA.jpeg" /><figcaption>JarvisAI’s Architecture</figcaption></figure><h3>5. Github Repository</h3><p>You can feel free to use my code. Star it if you like my work, and subscribe on <a href="https://www.youtube.com/DIPESHPAL17">YouTube</a> if you love it.</p><p>Just clone the repository- <a href="https://github.com/Dipeshpal/Jarvis-Assisant.git">https://github.com/Dipeshpal/Jarvis-Assisant.git</a></p><p>Then run ‘pip install -r requirements.txt’</p><p>It will automatically install everything.</p><h3>6. How you can contribute-</h3><p><strong>By Suggesting Ideas:</strong> <a href="https://github.com/Dipeshpal/Jarvis_AI/discussions">https://github.com/Dipeshpal/Jarvis_AI/discussions</a></p><p><strong>By finding Bugs:</strong> <a href="https://github.com/Dipeshpal/Jarvis_AI/issues">https://github.com/Dipeshpal/Jarvis_AI/issues</a></p><p><strong>By Contributing to code:</strong> Just open this<a href="https://github.com/Dipeshpal/Jarvis_AI"> GitHub repository</a><em>, </em>read it you will understand how you can contribute.</p><p><strong><em>Your contribution will reflect on </em></strong><a href="https://pypi.org/project/JarvisAI/"><strong><em>this project</em></strong></a><strong><em>.</em></strong></p><h3>7. References-</h3><ul><li>GitHub repository and Code Demo: <a href="https://github.com/Dipeshpal/Jarvis-Assisant.git">https://github.com/Dipeshpal/Jarvis-Assisant</a></li><li>GitHub Pypi repository to contribute: <a href="https://github.com/Dipeshpal/Jarvis_AI"><strong><em>https://github.com/Dipeshpal/Jarvis_AI</em></strong></a></li><li>JarvisAI Library: <a href="https://pypi.org/project/JarvisAI/"><strong><em>https://pypi.org/project/JarvisAI/</em></strong></a></li><li>YouTube Channel: <a href="https://www.youtube.com/DIPESHPAL17">https://www.youtube.com/DIPESHPAL17</a></li><li>Demo and Code (YouTube) version 1: <a href="https://youtu.be/LliTjuxDw_o">https://youtu.be/LliTjuxDw_o</a></li><li>Demo and Code (YouTube) version 1: <a href="https://youtu.be/C-sKlSULLrI">https://youtu.be/C-sKlSULLrI</a></li></ul><h3>8. How to stay updated about new builds and releases?</h3><ul><li>JarvisAI Library: <a href="https://pypi.org/project/JarvisAI/"><strong><em>https://pypi.org/project/JarvisAI/</em></strong></a></li><li>YouTube Channel: <a href="https://www.youtube.com/DIPESHPAL17">https://www.youtube.com/DIPESHPAL17</a></li></ul><blockquote><em>Buy me a coffee: </em><a href="https://www.buymeacoffee.com/dipeshpal"><em>https://www.buymeacoffee.com/dipeshpal</em></a></blockquote><blockquote><em>Don’t have money?</em></blockquote><blockquote><em>Subscribe me on YouTube: </em><a href="https://www.youtube.com/DIPESHPAL17"><em>https://www.youtube.com/dipeshpal</em></a><em>17</em></blockquote><h3>— Past Articles</h3><ul><li><a href="https://medium.com/analytics-vidhya/face-recognition-with-python-and-deep-learning-in-5-lines-5-minutes-39a5bf798267">Face Recognition with Python and Deep Learning in 5 Lines 10 Minutes</a></li><li><a href="https://medium.com/analytics-vidhya/blur-or-change-background-of-images-using-machine-learning-with-tensorflow-f7dab3ddab6f">Blur or Change Background of Images using Machine Learning with Tensorflow</a></li><li><a href="https://medium.com/analytics-vidhya/humans-image-segmentation-with-unet-using-tensorflow-keras-fd6cb43b06e5">Humans Image Segmentation with Unet using Tensorflow Keras</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a5c4f031a1e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/create-an-ai-based-intelligent-virtual-assistant-in-4-lines-of-python-jarvisai-4-0-1a5c4f031a1e">Create an AI-based Intelligent Virtual Assistant in 4 lines of Python (JarvisAI-4.0)</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lifetime Free Hosting with cPanel Latest working Method 2022 | My Personal Method]]></title>
            <link>https://dipeshpal17.medium.com/lifetime-free-hosting-with-cpanel-latest-working-method-2022-my-personal-method-c215d55368c4?source=rss-f438a2ca19ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/c215d55368c4</guid>
            <category><![CDATA[free-hosting-india]]></category>
            <category><![CDATA[free-hosting]]></category>
            <category><![CDATA[free-webhosting]]></category>
            <category><![CDATA[how-to-get-free-hosting]]></category>
            <category><![CDATA[free-hosting-service]]></category>
            <dc:creator><![CDATA[Dipesh Pal]]></dc:creator>
            <pubDate>Tue, 10 May 2022 06:35:50 GMT</pubDate>
            <atom:updated>2022-05-10T06:35:50.901Z</atom:updated>
            <content:encoded><![CDATA[<p>Budget is the most common problem beginners face when building a website. In the learning or testing process, no one wants to spend money on a Web Hosting service that costs them a lot. It would be great if you could get free web hosting for your website. All you have to do is choose the right platform for your website and you’re good to go.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7BHYcNuaxvkJ8v5mqDEj4Q.png" /><figcaption>Free Webhosting</figcaption></figure><p>Let’s have a quick look at Web Hosting. Storage space on a server is provided for your website with Web Hosting. Users can access your website through the internet if it is uploaded on such a server. The users need to enter your site’s URL into the web browser. Users will be able to see the web pages on the computer. It is better to use no-cost hosting platforms if you want to launch your website for testing or if you are a learner or student.</p><h4>Let’s talk about Hostpoco-</h4><p><strong><em>Well, I have uploaded my experience video on YouTube, if you don’t prefer reading watch this-</em></strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FZjyFJymPzbA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DZjyFJymPzbA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FZjyFJymPzbA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/cc6e65d924fead8c4b7e4fbcae982f90/href">https://medium.com/media/cc6e65d924fead8c4b7e4fbcae982f90/href</a></iframe><p>If you want to run a small business or test a website without spending a lot of money, then free website hosting is perfect for you. HostPoco has been providing Free Hosting for years. The best hosting experience for clients can be found in our free service. Hundreds of clients have been using their free service for the last 3 years, and they never forced them for paid service. The Free Startup plan offers 200MB space, 200MB Bandwidth, Subdomain, Email Accounts, Stat programs, and more. You can try their free service because most of the clients have already moved with Hostpoco.</p><p><strong>FREE Startup: $0/Lifetime</strong></p><ul><li>Single Domain Hosting</li><li>200MB Web Space</li><li>200MB Bandwidth</li><li>2 Email Accounts</li><li>2 Sub Domains</li><li>FREE Auto SSL</li><li>DDOS Protection</li><li>99.99% uptime</li><li>Softaculous Supported</li><li>Tier 1 Technical Support</li></ul><p><strong>Do you have any questions?</strong></p><p>Connect me on my Instagram: <a href="https://www.instagram.com/techportofficial/">https://www.instagram.com/techportofficial</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c215d55368c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Generates Code Using Python and OpenAI’s GPT-3]]></title>
            <link>https://medium.com/analytics-vidhya/ai-generates-code-using-python-and-openais-gpt-3-2ddc95047cba?source=rss-f438a2ca19ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ddc95047cba</guid>
            <category><![CDATA[gpt-3]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai-chatbot]]></category>
            <category><![CDATA[code-generation]]></category>
            <dc:creator><![CDATA[Dipesh Pal]]></dc:creator>
            <pubDate>Sat, 10 Jul 2021 09:06:53 GMT</pubDate>
            <atom:updated>2021-07-12T06:54:07.097Z</atom:updated>
            <content:encoded><![CDATA[<p>Today AI is generating all the code you need, you no need to write the code you can just do the supervision. If you want and focus more on logic and get more productivity. Since the GPT-3 is released, it changes how we deal with text in the AI-ML world. <a href="https://openai.com/blog/gpt-3-apps/#:~:text=given%20any%20text%20prompt%20like%20a%20phrase%20or%20a%20sentence%2C%20gpt-3%20returns%20a%20text%20completion%20in%20natural%20language.%20developers%20can%20%E2%80%9Cprogram%E2%80%9D%20gpt-3%20by%20showing%20it%20just%20a%20few%20examples%20or%20%E2%80%9Cprompts.%E2%80%9D">Given any text prompt like a phrase or a sentence, GPT-3 returns a text completion in natural language. Developers can “program” GPT-3 by showing it just a few examples or “prompts.”</a></p><p>You must hear about <a href="https://copilot.github.com/">Github Copilot</a>, well is that really true that AI will replace humans? Let me know your thoughts.</p><figure><img alt="AI Generates Code" src="https://cdn-images-1.medium.com/max/1024/1*Buf2CHuZ1d8RMO0iwsELFg.png" /></figure><p><strong>In this article, we will talk about the basic usages of GPT-3. The contents of the articles are-</strong></p><ol><li>How to get API access for GPT-3?</li><li>What GPT-3 can do?</li><li>Use Cases</li><li>Code examples with Python (Explanation)</li><li>Github Code</li><li>YouTube Video Demo and Quick Explanation</li><li>What next?</li><li>You might be interested in…</li><li>Contact me</li><li>Sources and Resources</li></ol><h3>1. How to get API access for GPT-3?</h3><ul><li><strong>Method 1 (Application form)-</strong> The first thing is to send an application on OpenAI’s official <a href="https://share.hsforms.com/1Lfc7WtPLRk2ppXhPjcYY-A4sk30">API Waitlist form</a>. The form is fairly simple and basically only asks about your intended use case.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4s1x9z1r14YokWuC.png" /></figure><ul><li><strong>Method 2 (Outreach)-</strong> There was a way to fast-track access by emailing Greg Brockman, OpenAI’s CTO.</li></ul><h3>Greg Brockman on Twitter: &quot;Anyone who would like to build an app on our API, please ping me - may be able to accelerate an invite to you! https://t.co/T6DqWfs4qS / Twitter&quot;</h3><p>Anyone who would like to build an app on our API, please ping me - may be able to accelerate an invite to you! https://t.co/T6DqWfs4qS</p><ul><li><strong>Method 3 (Stand out)- </strong>If you don’t receive access to the above methods, our suggestion is to do something that shows your enthusiasm and gets OpenAI excited about you and your use case</li></ul><h3>2. What GPT-3 can do?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*zqwV6x4riWjgAWTYNVHP8Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*kuY5JTx-BJQp_8NgeLweVw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*jREMRIio0iLCzE5Mi-3gqQ.png" /></figure><p><a href="https://beta.openai.com/examples">OpenAI API</a></p><h3>3. Use Cases</h3><p>Some of the great folks did magnificently works, let&#39;s see some of the samples-</p><ul><li><strong>Code Generator-</strong></li></ul><h3>Sharif Shameem on Twitter: &quot;This is mind blowing.With GPT-3, I built a layout generator where you just describe any layout you want, and it generates the JSX code for you.W H A T pic.twitter.com/w8JkrZO4lk / Twitter&quot;</h3><p>This is mind blowing.With GPT-3, I built a layout generator where you just describe any layout you want, and it generates the JSX code for you.W H A T pic.twitter.com/w8JkrZO4lk</p><h3>Sharif Shameem on Twitter: &quot;I built a todo list app simply by describing it to GPT-3.It generated the React code for a fully functioning app within seconds.I&#39;m becoming more impressed and aware of its capabilities every single day. pic.twitter.com/QGrClar03s / Twitter&quot;</h3><p>I built a todo list app simply by describing it to GPT-3.It generated the React code for a fully functioning app within seconds.I&#39;m becoming more impressed and aware of its capabilities every single day. pic.twitter.com/QGrClar03s</p><ul><li><strong>Designer: </strong>Here is a beautiful integration of the Figma plugin and GPT-3 to generate beautiful web templates. The developer inputs the following text:</li></ul><p>“An app that has a navigation bar with a camera icon, “Photos” title, and a message icon. A feed of photos with each photo having a user icon, a photo, a heart icon, and a chat bubble icon”</p><p>And generates this beautiful, simple application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*gFsh8Jmuy5VYzOVb" /></figure><ul><li><strong>JSX Layout Maker: </strong>This was one of the first examples of GPT-3 to generate code that caught the attention of the tweeple. It shows how to generate a JSX layout just by defining it in plain English.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QGTgyjzdRf4RjWBp" /></figure><ul><li><strong>Regex Generator: Y</strong>ou input the Regex you want in plain English, provide an example string that will match, and generates the Regex in seconds.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7smW-WnQYXkMeFJb" /></figure><h3>Sources and Other Use Cases-</h3><ol><li><a href="https://twitter.com/amasad/status/1285789362647478272">Code Oracle</a></li><li><a href="https://twitter.com/jsngr/status/1284511080715362304">Designer</a></li><li><a href="https://twitter.com/sharifshameem/status/1282676454690451457">JSX Layout maker</a></li><li><a href="https://twitter.com/parthi_logan/status/1286818567631982593">Regex Generator</a></li><li><a href="https://twitter.com/jsngr/status/1287026808429383680">Website mocker</a></li><li><a href="https://twitter.com/siddkaramcheti/status/1286168606896603136">Object use-case generation</a></li><li><a href="https://twitter.com/aquariusacquah/status/1285415144017797126">Autoplotter</a></li><li><a href="https://twitter.com/calvinfo/status/1286332337563684865">A complete evaluation</a></li><li><a href="https://twitter.com/learn_awesome/status/1286189729826738176">Quiz Producer</a></li><li><a href="https://twitter.com/mckaywrigley/status/1284110063498522624">Learn from anyone</a></li><li><a href="https://twitter.com/raphamilliere/status/1289129723310886912">The Philosopher</a></li><li><a href="https://twitter.com/mattshumer_/status/1287125015528341506">The AI recursion</a></li><li><a href="https://twitter.com/wowitsmrinal/status/1287175391040290816">The Meme Maker</a></li><li><a href="https://twitter.com/sh_reya/status/1284746918959239168">The LaTeX Fabricator</a></li><li><a href="https://twitter.com/sonnylazuardi/status/1287563878545514496">The Animator</a></li><li><a href="https://twitter.com/nutanc/status/1287801677542612992">The Interactive Voice Response creator</a></li><li><a href="https://twitter.com/antonio_gomezm/status/1287969287110443008">The 3-D Scene generator</a></li><li><a href="https://twitter.com/doncubed/status/1284908940149395456">Resume Creator</a></li><li><a href="https://twitter.com/chinyasuhail/status/1287110006370836480">Dev Ops Engineer</a></li><li><a href="https://twitter.com/nutanc/status/1285196429393137665">Cricket Commentator</a></li></ol><h3>4. Code examples with Python (Explanation)</h3><p>Let&#39;s talk about some technical aspects then I’ll show you the complete code as well.</p><p>The folder structure of my project is-</p><ul><li>I have put some Python code in examples in the ‘examples’ directory with the program name/title as the file name. These examples I’ll feed later to GPT-3.</li><li>gpt.py- Some of the useful functions to use Openai’s GPT-3. It contains functions to add examples, predict, configure, etc. Basically, you do need to worry about this file. You can use this piece of code in your code file (main.py in our case).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*NkpREA5v20zTYJp3OdaIxg.png" /></figure><ul><li>main.py- It is the treasure for which you are here. Well just have a look into the code then I’ll explain-</li></ul><pre>from key import *<br>import glob<br>import openai<br>from gpt import GPT<br>from gpt import Example<br><br># configure GPT<br>openai.api_key = key<br>gpt = GPT(engine=&quot;davinci&quot;,<br>          temperature=0.5,<br>          output_prefix=&quot;Output: \n\n&quot;,<br>          max_tokens=100)<br><br># add some code examples<br>for file in glob.glob(&quot;examples/*&quot;):<br>    title = file.replace(&quot;_&quot;, &quot; &quot;)<br>    with open(f&quot;{file}&quot;, &quot;r&quot;) as f:<br>        code = f.read()<br>    gpt.add_example(Example(title, code))<br><br># add some calculation examples<br>gpt.add_example(Example(&quot;add 3+5&quot;, &quot;8&quot;))<br>gpt.add_example(Example(&quot;add 8+5&quot;, &quot;13&quot;))<br>gpt.add_example(Example(&quot;add 50+25&quot;, &quot;75&quot;))<br><br># Inferences<br>prompt = &quot;sort list in python&quot;<br>output = gpt.get_top_reply(prompt)<br>print(prompt, &quot;:&quot;, output)<br>print(&quot;----------------------------------------&quot;)<br><br>prompt = &quot;Code weather api in python&quot;<br>output = gpt.get_top_reply(prompt)<br>print(prompt, &quot;:&quot;, output)<br>print(&quot;----------------------------------------&quot;)<br><br>prompt = &quot;What is 876+89&quot;<br>output = gpt.get_top_reply(prompt)<br>print(prompt, &quot;:&quot;, output)<br>print(&quot;----------------------------------------&quot;)</pre><p>Most of the code is self-explanatory. Well, I am iterating over the ‘examples’ directory and while iterating I am adding examples in GPT-3 API.</p><pre>gpt.add_example(Example(&quot;add 3+5&quot;, &quot;8&quot;))</pre><p>The above lines take two arguments in Example, “add 3+5” is the input and the “8” is the output that you are expecting GPT-3 to perform.</p><p>Similarly, you can feed different kinds of examples to the model and explore the possibilities.</p><p>I have given two kinds of examples, in the first example, I have given some python code with a description of code-</p><pre># add some code examples<br>for file in glob.glob(&quot;examples/*&quot;):<br>    title = file.replace(&quot;_&quot;, &quot; &quot;)<br>    with open(f&quot;{file}&quot;, &quot;r&quot;) as f:<br>        code = f.read()<br>    gpt.add_example(Example(title, code))</pre><p>In the second example, I have given a basic math calculation example-</p><pre># add some calculation examples<br>gpt.add_example(Example(&quot;add 3+5&quot;, &quot;8&quot;))<br>gpt.add_example(Example(&quot;add 8+5&quot;, &quot;13&quot;))<br>gpt.add_example(Example(&quot;add 50+25&quot;, &quot;75&quot;))</pre><blockquote>Let&#39;s check the API’s outputs-</blockquote><p><strong><em>The following is the output for “prompt = ‘Code weather API in python’”</em></strong></p><p><strong>Understand the output-</strong> I have “set max_tokens=100” in code, you can change it according to your choice. Well, this will increase or decrease the output length.</p><p>The output looks pretty awesome, It has changed the variable name and given lots of other things as output.</p><p><strong>The example I have fed to this API is-</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*RDaH5AYQX5AA6rAeNi_gsA.png" /></figure><p><strong>The output I have got is-</strong></p><pre>prompt = &quot;Code weather api in python&quot;<br>output = gpt.get_top_reply(prompt)<br>print(prompt, &quot;:&quot;, output)</pre><p>Below is the output for the above prompt-</p><pre>Code weather api in python : Output:<br>import requests<br>r = requests.get(&#39;http://api.openweathermap.org/data/2.5/weather?q=London&amp;APPID={APIKEY}&#39;)<br>data = r.json()<br>print(data[&#39;weather&#39;][0][&#39;description&#39;])<br>print(data[&#39;main&#39;][&#39;temp&#39;])<br>print(data[&#39;main&#39;][&#39;temp_min&#39;])<br>print(data[&#39;main&#39;][</pre><p><strong><em>The following is the output for sorting list in python without using sort function-</em></strong></p><p><strong>Understand the output- </strong>Well this time it feels like it has remembered my code exactly but yeah this is what I have got.</p><p><strong>The example I have fed to this API is-</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*x_80cBZsPvg9_4Jb1qjWpQ.png" /></figure><p><strong>The output I have got is-</strong></p><pre>prompt = &quot;sort list in python&quot;<br>output = gpt.get_top_reply(prompt)<br>print(prompt, &quot;:&quot;, output)</pre><p>Below is the output for the above prompt-</p><pre>sort list in python : Output: <br><br>def fun(l):<br>    list_len = len(l)<br>    for i in range(list_len):<br>        if i &lt; list_len - 1:<br>            if l[i] &gt; l[i + 1]:<br>               l[i], l[i + 1</pre><p><strong><em>The following is the output for maths calculation in python-</em></strong></p><p><strong>Understand the output- </strong>I have fed very basic examples to the API for the addition but it can do the addition of large numbers as well. I am very sure that it will able to solve pretty long mathematical expressions as well.</p><p><strong>The example I have fed to this API is-</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/409/1*-EnsAeUehyV_2d_uq4aF6Q.png" /></figure><p><strong>The output I have got is-</strong></p><pre>prompt = &quot;What is 876+89&quot;<br>output = gpt.get_top_reply(prompt)<br>print(prompt, &quot;:&quot;, output)</pre><p>Below is the output for the above prompt-</p><pre>What is 876+89 : Output: <br><br>865</pre><h3>5. Github Code-</h3><p><a href="https://github.com/Dipeshpal/AI-Generates-Code-Using-Python-and-GPT-3">Dipeshpal/AI-Generates-Code-Using-Python-and-GPT-3</a></p><p>Just fork it, start it, add your key in the ‘key.py’ file, and then run the ‘main.py’ file.</p><h3>6. YouTube Video Demo and Quick Explanation</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F55_AeKW-YpQ&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D55_AeKW-YpQ&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1450b0f7002dae6f45e39b12ce6d07c7/href">https://medium.com/media/1450b0f7002dae6f45e39b12ce6d07c7/href</a></iframe><h3>7. What Next?</h3><p>If you want a tutorial on these then comment down or mail me or DM me on Instagram.</p><h4>* CLIP: Connecting Text and Images</h4><p>OpenAI introduces <a href="https://openai.com/blog/clip/#:~:text=a%20neural%20network%20called%20clip%20which%20efficiently%20learns%20visual%20concepts%20from%20natural%20language%20supervision.%20clip%20can%20be%20applied%20to%20any%20visual%20classification%20benchmark%20by%20simply%20providing%20the%20names%20of%20the%20visual%20categories%20to%20be%20recognized%2C%20similar%20to%20the%20%E2%80%9Czero-shot%E2%80%9D%20capabilities%20of%20gpt-2%20and%20gpt-3">a neural network called CLIP which efficiently learns visual concepts from natural language supervision. CLIP can be applied to any visual classification benchmark by simply providing the names of the visual categories to be recognized, similar to the “zero-shot” capabilities of GPT-2 and GPT-3.</a></p><h4>* DALL·E: Creating Images from Text</h4><p>OpenAI introduces <a href="https://openai.com/blog/dall-e/#:~:text=a%20neural%20network%20called%20dall%C2%B7e%20that%20creates%20images%20from%20text%20captions%20for%20a%20wide%20range%20of%20concepts%20expressible%20in%20natural%20language.">a neural network called DALL·E that creates images from text captions for a wide range of concepts expressible in natural language.</a></p><h3>8. You might be interested in…</h3><ul><li><a href="https://medium.com/analytics-vidhya/how-to-create-virtual-assistant-in-python-10-min-50-lines-of-code-no-need-to-buy-alexa-build-7ad5102c57ba">How to create virtual assistant in Python 10 min 50 lines of code | No need to buy ALEXA, BUILD…</a></li><li><a href="https://medium.com/analytics-vidhya/face-recognition-with-python-and-deep-learning-in-5-lines-5-minutes-39a5bf798267">Face Recognition with Python and Deep Learning in 5 Lines 5 Minutes</a></li><li><a href="https://medium.com/analytics-vidhya/blur-or-change-background-of-images-using-machine-learning-with-tensorflow-f7dab3ddab6f">Blur or Change Background of Images using Machine Learning with Tensorflow</a></li><li><a href="https://medium.com/analytics-vidhya/humans-image-segmentation-with-unet-using-tensorflow-keras-fd6cb43b06e5">Humans Image Segmentation with Unet using Tensorflow Keras</a></li><li><a href="https://huggingface.co/course/chapter1">Transformer models - Hugging Face Course</a></li></ul><h3>9. Contact me-</h3><p>Buy me a coffee:</p><p><a href="https://www.buymeacoffee.com/dipeshpal">Dipesh Pal is A tech creator at YouTube</a></p><p>Don’t have money?</p><p>Subscribe to me on YouTube:</p><p><a href="https://www.youtube.com/channel/UCGEoRAK92fUk2kY3kSJMR_Q">Dipesh Pal</a></p><p>Follow me on Instagram:</p><p><a href="https://www.instagram.com/dipesh_pal17/">https://www.instagram.com/dipesh_pal17</a></p><h3>10. Sources and Resources-</h3><p><a href="https://openai.com/">https://openai.com/</a></p><p><a href="https://github.com/shreyashankar/gpt3-sandbox">https://github.com/shreyashankar/gpt3-sandbox</a></p><p><a href="https://github.com/bhattbhavesh91/gpt-3-simple-tutorial">https://github.com/bhattbhavesh91/gpt-3-simple-tutorial</a></p><p><a href="https://forms.office.com/Pages/ResponsePage.aspx?id=VsqMpNrmTkioFJyEllK8sx3ELsv0PEhHphhNz30FttVUNkYwTlNPMVI1V0lXNjExMlExUlc4SE5YSS4u">https://forms.office.com/Pages/ResponsePage.aspx?id=VsqMpNrmTkioFJyEllK8sx3ELsv0PEhHphhNz30FttVUNkYwTlNPMVI1V0lXNjExMlExUlc4SE5YSS4u</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ddc95047cba" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/ai-generates-code-using-python-and-openais-gpt-3-2ddc95047cba">AI Generates Code Using Python and OpenAI’s GPT-3</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to create virtual assistant in Python 10 min 50 lines of code | No need to buy ALEXA, BUILD…]]></title>
            <link>https://medium.com/analytics-vidhya/how-to-create-virtual-assistant-in-python-10-min-50-lines-of-code-no-need-to-buy-alexa-build-7ad5102c57ba?source=rss-f438a2ca19ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ad5102c57ba</guid>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[machine-learning-ai]]></category>
            <category><![CDATA[alexa]]></category>
            <category><![CDATA[virtual-assistant]]></category>
            <dc:creator><![CDATA[Dipesh Pal]]></dc:creator>
            <pubDate>Fri, 29 Jan 2021 13:49:43 GMT</pubDate>
            <atom:updated>2021-01-29T16:21:23.468Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to create virtual assistant in Python 10 min 50 lines of code | No need to buy ALEXA, BUILD your JARVIS</h3><h3>Introduction</h3><p>A virtual assistant, also called an AI assistant or digital assistant, is an application program that understands natural language voice commands and completes tasks for the user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*35ys5KZXBHW5qH0lSUKb2w.jpeg" /><figcaption>Jarvis AI 2.0 Python Virtual Assistant</figcaption></figure><blockquote>A virtual assistant, also called an AI assistant or digital assistant, is an application program that understands natural language voice commands and completes tasks for the user.</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FC-sKlSULLrI&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DC-sKlSULLrI&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2215cac6da04d5a0794d0cc17bc4f03f/href">https://medium.com/media/2215cac6da04d5a0794d0cc17bc4f03f/href</a></iframe><h4>Previous Version Demo: <a href="https://youtu.be/LliTjuxDw_o">https://youtu.be/LliTjuxDw_o</a></h4><h3>Content-</h3><ol><li>What we are building-</li><li>Code Explanation</li><li>Complete code</li><li>GitHub Repository</li><li>How you can contribute</li><li>References</li><li>How to stay updated about new builds and release</li></ol><h3>1. What we are building-</h3><p><strong>Our virtual assistant will able to do the followings things-</strong></p><ul><li>Voice Recognition</li><li>Text to Speech</li><li>Open Photos</li><li>Open Google Photos</li><li>Tells you joke</li><li>Shutdown your system</li><li>Weather forecasting</li><li>Launch Games</li><li>Launch Windows Applications</li><li>Open Websites</li><li>Tells you about almost everything you ask</li><li>Tells you date and time</li><li>Greetings</li><li>News</li><li>Face Recognition (need to train ML model)</li></ul><p>You can <strong><em>interact with your laptop’s microphone/console</em></strong>. The response generated by the assistant will <strong><em>display on the console or as a speech via</em></strong> the speaker.</p><p><strong>Future Updates: Selfie Click, Chat more like humans, etc. You tell me what do you want. Or contribute in </strong><a href="https://pypi.org/project/JarvisAI/"><strong><em>https://pypi.org/project/JarvisAI</em></strong></a></p><h3>2. Code Explanation-</h3><p>So let’s create our own virtual assistant.</p><p><strong><em>Notes-</em></strong></p><ul><li>All the codes is available on my GitHub.</li><li>Demo YouTube video and code YouTube video is also available on my channel.</li><li>Required links and packages are mentioned below.</li><li>Sharing and <a href="https://www.youtube.com/dipeshpal17">Subscribe me on YouTube</a> would be appreciated</li><li>The code and functions may be update on future so stay tuned with me on <a href="https://www.youtube.com/dipeshpal17">YouTube</a> and this project <a href="https://pypi.org/project/JarvisAI/">official page</a>.</li></ul><p><strong><em>Lets code-</em></strong></p><h4>2.1. Required packages and libraries-</h4><p><a href="https://pypi.org/project/JarvisAI/">https://pypi.org/project/JarvisAI/</a></p><pre>pip install JarvisAI</pre><p>This is the latest virtual assistant module, created by me. It provides the basic functionality of any virtual assistant. The prerequisite is only Python (&gt; 3.6).</p><h3>Usage and Features-</h3><p>After installing the library you can import the module-</p><pre>import JarvisAI<br>obj = JarvisAI.JarvisAssistant()<br>response = obj.mic_input()<br>print(response)</pre><p><strong>Check this script for more examples-</strong> <a href="https://github.com/Dipeshpal/Jarvis-Assisant/blob/master/scripts/main.py">https://github.com/Dipeshpal/Jarvis-Assisant/blob/master/scripts/main.py</a></p><h4>Available Methods-</h4><p>The functionality is cleared by methods name. You can check the code for example. These are the names of available functions you can use after creating JarvisAI’s object-</p><pre>import JarvisAI<br>obj = JarvisAI.JarvisAssistant()<br>response = obj.mic_input()</pre><ol><li>res = obj.mic_input(lang=’en’)</li><li>res = obj.website_opener(“facebook”)</li><li>res = obj.send_mail(sender_email=None, sender_password=None, receiver_email=None, msg=”Hello”)</li><li>res = obj.launch_app(“edge”)</li><li>res = obj.weather(city=’Mumbai’)</li><li>res = obj.news()</li><li>res = obj.tell_me(topic=’India’, sentences=1)</li><li>res = obj.tell_me_time()</li><li>res = obj.tell_me_date()</li><li>res = obj.shutdown()</li><li>res = obj.text2speech(text=’Hello, how are you?’, lang=’en’)</li><li>res = obj.datasetcreate(dataset_path=’datasets’, class_name=’Demo’, haarcascade_path=’haarcascade/haarcascade_frontalface_default.xml’, eyecascade_path=’haarcascade/haarcascade_eye.xml’, eye_detect=False, save_face_only=True, no_of_samples=100, width=128, height=128, color_mode=False)</li><li>res = obj.face_recognition_train(data_dir=’datasets’, batch_size=32, img_height=128, img_width=128, epochs=10, model_path=’model’, pretrained=None, base_model_trainable=False)</li><li>res = obj.predict_faces(class_name=None, img_height=128, img_width=128, haarcascade_path=’haarcascade/haarcascade_frontalface_default.xml’, eyecascade_path=’haarcascade/haarcascade_eye.xml’, model_path=’model’, color_mode=False)</li><li>res = obj.setup()</li><li>res = obj.show_me_my_images()</li><li>res= show_google_photos()</li><li>res = tell_me_joke(language=’en’, category=’neutral’)</li><li>res = hot_word_detect(lang=’en’)</li></ol><blockquote>The above methods are very clear by their name itself. Read on GitHub or Pypi’s Jarvis_AI official page for more information.</blockquote><h3>2.2. Code-</h3><h4>Step 1 (Imports and Create Object of JarvisAI)-</h4><pre><em>import </em>JarvisAI<br><em>import </em>re<br><em>import </em>pprint<br><em>import </em>random</pre><p><strong>Object creation</strong> of JarvisAI as per as <a href="https://pypi.org/project/JarvisAI/">documentation</a>–</p><pre>obj = JarvisAI.JarvisAssistant()</pre><p>We have created this ‘t2s(text)’ function. <strong>This will convert any text to speech.</strong> The entire program we will use (call) this function to produce speech from text.</p><h4>Step 2 (Create text2speech or speak function)-</h4><pre><em>def </em>t2s(text):<br>    obj.text2speech(text)</pre><h4>Step 3 (<strong>continuously </strong>listen on background and HOT WORD Detection)-</h4><p><strong>We want to continuously listen to input from the user,</strong> so we will use while loop here.</p><h4><strong>We will use ‘hot_word_detect()’ function. Why? What it is?</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*GMTB5UDf7RrS0iubJqt1Kw.png" /><figcaption>What is hot word detection</figcaption></figure><p>I guess no need to explain what it is.</p><p>This hot_word_detect will start listening your voice in the background. So this hot word detection will return 2 things ‘status’ and ‘command’. Status is boolean and command is the text whatever you speak. If your desire hot_word is detected then it will return status=True.</p><pre><em>while True</em>:<br>    status, command = obj.hot_word_detect()<br>    <em>if </em>status:<br>        <em># We will do something...</em></pre><p>Okay, suppose your run this much of code. It will first ask to setup few things, if you are running the program for the first time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KPjlLIa-CGbZ62ksLmaQeA.png" /><figcaption>Setup Initial Things</figcaption></figure><p>Once done, it will create a “config/config.ini” file. It has configuration related to your virtual assistant.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*56Kb84oIPVOpTzSvIAfIrw.png" /><figcaption>config.ini</figcaption></figure><p>Now run the script again, it will start listing your voice in background.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*GOWjD2qtya27GaMz6EYxlg.png" /><figcaption>Background Listening</figcaption></figure><p>To wake up assistant you need to say your hot word. Hot word is your bot_name in config.ini file.</p><p>So, you can says- “Hello alexa”, “Hi alexa”, “blah blah alexa”. Only one saying hot word your assistant will we wake up. Otherwise it will keep listening in background.</p><h4>Step 4 (After Hot Word Detection, Give Commands via microphone)-</h4><p>So, if status is “TRUE” then we want to use mic_input() this will listen your voice again from your microphone. Now you can say anything. It will convert your voice into text.</p><pre><em>while True</em>:<br>    status, command = obj.hot_word_detect()<br>    <em>if </em>status:<br>        <em>while True</em>:<br>            res = obj.mic_input()<br>            print(res)</pre><h4>Step 5 (Perform action according to user command, Let’s implement Jokes)-</h4><p>Suppose user says- “Tell me a joke”.</p><p>Now we will use regex to match desire word in user input. We want to match “jokes|joke|Jokes|Joke” any of these patterns in “res” below.</p><p>(Note: ‘res’ stands for ‘response’ here. I am super lazy so that’s why I wrote ‘res’)</p><pre><em>while True</em>:<br>    status, command = obj.hot_word_detect()<br>    <em>if </em>status:<br>        <em>while True</em>:<br>            res = obj.mic_input()<br>            print(res)<br><br>            <em>if </em>re.search(&quot;jokes|joke|Jokes|Joke&quot;, res):<br>                joke_ = obj.tell_me_joke(&#39;en&#39;, &#39;neutral&#39;)<br>                print(joke_)<br>                t2s(joke_)<br>                <em>break</em></pre><p>If pattern (“jokes|joke|Jokes|Joke”) found in “res” then we want to call <strong><em>tell_me_joke(‘en’, ‘neutral’). </em></strong><em>This will return single joke as ‘str’. </em>We can print this and also use our “t2s” function to speak (convert this text into voice).</p><h4>Step 6 (Now Implements other actions as well)-</h4><p><strong>One more example-</strong></p><p><strong>Implement Date and Time:</strong> It will tell you the current date and time of your system.</p><pre><em>if </em>re.search(&#39;date&#39;, res):<br>        date = obj.tell_me_date()<br>        print(date)<br>        print(t2s(date))<br>        break</pre><pre><em>if </em>re.search(&#39;time&#39;, res):<br>        time = obj.tell_me_time()<br>        print(time)<br>        t2s(time)<br>        break</pre><p><strong>You can define your if-else based logic as above we used in “jokes” and call any of these methods accordingly-</strong></p><ul><li>website_opener_res = obj.website_opener(“facebook”)</li><li>mail_res = obj.send_mail(sender_email=None, sender_password=None, receiver_email=None, msg=”Hello”)</li><li>launch_app_res = obj.launch_app(“edge”)</li><li>weather_res = obj.weather(city=’Mumbai’)</li><li>news_res = obj.news()</li><li>topic_res = obj.tell_me(topic=’India’, sentences=1)</li><li>time_res = obj.tell_me_time()</li><li>date_res = obj.tell_me_date()</li><li>shutdown_res = obj.shutdown()</li><li>setup_res = obj.setup()</li><li>local_dir_images_res = obj.show_me_my_images()</li><li>google_photos_res = show_google_photos()</li><li>joke_res = tell_me_joke(language=’en’, category=’neutral’)</li><li>wake_word_res = hot_word_detect(lang=’en’)</li><li>datasetcreate_res = obj.datasetcreate(dataset_path=’datasets’, class_name=’Demo’, haarcascade_path=’haarcascade/haarcascade_frontalface_default.xml’, eyecascade_path=’haarcascade/haarcascade_eye.xml’, eye_detect=False, save_face_only=True, no_of_samples=100, width=128, height=128, color_mode=False)</li><li>face_recognition_train_res = obj.face_recognition_train(data_dir=’datasets’, batch_size=32, img_height=128, img_width=128, epochs=10, model_path=’model’, pretrained=None, base_model_trainable=False)</li><li>predict_faces_res = obj.predict_faces(class_name=None, img_height=128, img_width=128, haarcascade_path=’haarcascade/haarcascade_frontalface_default.xml’, eyecascade_path=’haarcascade/haarcascade_eye.xml’, model_path=’model’, color_mode=False)</li></ul><h3>3. Complete code-</h3><p>Demo Script-</p><p><a href="https://github.com/Dipeshpal/Jarvis-Assisant/blob/master/scripts/main.py">Dipeshpal/Jarvis-Assisant</a></p><h3>4. Github Repository</h3><p>You can feel free to use my code. Star it if you like my work, subscribe on <a href="https://www.youtube.com/DIPESHPAL17">YouTube</a> if you love.</p><p>Just clone the repository- <a href="https://github.com/Dipeshpal/Jarvis-Assisant.git">https://github.com/Dipeshpal/Jarvis-Assisant.git</a></p><p>Then run pip install -r requirements.txt</p><p>It will automatically install everything.</p><h3>5. How you can contribute-</h3><p><strong>By Suggesting Ideas:</strong> <a href="https://github.com/Dipeshpal/Jarvis_AI/discussions">https://github.com/Dipeshpal/Jarvis_AI/discussions</a></p><p><strong>By finding Bugs:</strong> <a href="https://github.com/Dipeshpal/Jarvis_AI/issues">https://github.com/Dipeshpal/Jarvis_AI/issues</a></p><p><strong>By Contributing on code:</strong> Just open this<a href="https://github.com/Dipeshpal/Jarvis_AI"> GitHub repository</a><em>, </em>read it you will understand how you can contribute.</p><p><strong><em>Your contribution will reflect on </em></strong><a href="https://pypi.org/project/JarvisAI/"><strong><em>this project</em></strong></a><strong><em>.</em></strong></p><h3>6. References-</h3><ul><li>GitHub repository and Code Demo: <a href="https://github.com/Dipeshpal/Jarvis-Assisant.git">https://github.com/Dipeshpal/Jarvis-Assisant</a></li><li>GitHub Pypi repository to contribute: <a href="https://github.com/Dipeshpal/Jarvis_AI"><strong><em>https://github.com/Dipeshpal/Jarvis_AI</em></strong></a></li><li>JarvisAI Library: <a href="https://pypi.org/project/JarvisAI/"><strong><em>https://pypi.org/project/JarvisAI/</em></strong></a></li><li>YouTube Channel: <a href="https://www.youtube.com/DIPESHPAL17">https://www.youtube.com/DIPESHPAL17</a></li><li>Demo and Code (YouTube) version 1: <a href="https://youtu.be/LliTjuxDw_o">https://youtu.be/LliTjuxDw_o</a></li><li>Demo and Code (YouTube) version 1: <a href="https://youtu.be/C-sKlSULLrI">https://youtu.be/C-sKlSULLrI</a></li></ul><h3>7. How to stay updated about new builds and release?</h3><ul><li>JarvisAI Library: <a href="https://pypi.org/project/JarvisAI/"><strong><em>https://pypi.org/project/JarvisAI/</em></strong></a></li><li>YouTube Channel: <a href="https://www.youtube.com/DIPESHPAL17">https://www.youtube.com/DIPESHPAL17</a></li></ul><blockquote><strong><em>Buy me a coffee: </em></strong><a href="https://www.buymeacoffee.com/dipeshpal"><strong><em>https://www.buymeacoffee.com/dipeshpal</em></strong></a></blockquote><blockquote>Don’t have money?</blockquote><blockquote>Subscribe me on YouTube: <a href="https://www.youtube.com/DIPESHPAL17">https://www.youtube.com/dipeshpal</a>17</blockquote><h3>— Past Articles</h3><ul><li><a href="https://medium.com/analytics-vidhya/face-recognition-with-python-and-deep-learning-in-5-lines-5-minutes-39a5bf798267">Face Recognition with Python and Deep Learning in 5 Lines 10 Minutes</a></li><li><a href="https://medium.com/analytics-vidhya/blur-or-change-background-of-images-using-machine-learning-with-tensorflow-f7dab3ddab6f">Blur or Change Background of Images using Machine Learning with Tensorflow</a></li><li><a href="https://medium.com/analytics-vidhya/humans-image-segmentation-with-unet-using-tensorflow-keras-fd6cb43b06e5">Humans Image Segmentation with Unet using Tensorflow Keras</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ad5102c57ba" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/how-to-create-virtual-assistant-in-python-10-min-50-lines-of-code-no-need-to-buy-alexa-build-7ad5102c57ba">How to create virtual assistant in Python 10 min 50 lines of code | No need to buy ALEXA, BUILD…</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Face Recognition with Python and Deep Learning in 5 Lines 5 Minutes]]></title>
            <link>https://medium.com/analytics-vidhya/face-recognition-with-python-and-deep-learning-in-5-lines-5-minutes-39a5bf798267?source=rss-f438a2ca19ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/39a5bf798267</guid>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[facedetection]]></category>
            <category><![CDATA[virtual-assistant]]></category>
            <category><![CDATA[machine-vision]]></category>
            <category><![CDATA[face-recognition]]></category>
            <dc:creator><![CDATA[Dipesh Pal]]></dc:creator>
            <pubDate>Mon, 19 Oct 2020 04:26:27 GMT</pubDate>
            <atom:updated>2020-10-19T04:26:27.518Z</atom:updated>
            <content:encoded><![CDATA[<h3>Face Recognition with Python and Deep Learning in 5 Lines 10 Minutes</h3><p>In this post I’ll show you how to create Face Recognition in 5 line with Python by using deep learning. Face Recognition and Detection is mostly the first project of any ML or AI student. Now you no need to write thousand of lines to perform this simple task.</p><p>All the code and resources are provided at the end, if you love my content just clap the article and subscribe me <a href="https://www.youtube.com/DIPESHPAL17">YouTube</a> for future updates.</p><h4>Demo and Code-</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FEU0LHtEJTnE&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DEU0LHtEJTnE&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d7567180f5629ab07774eb41f28d2cec/href">https://medium.com/media/d7567180f5629ab07774eb41f28d2cec/href</a></iframe><h4>Content-</h4><ol><li>What is Face Recognition</li><li>What is Face Detection</li><li>Introduction of ‘auto_face_recognition’ python library</li><li>How things works</li><li>Code</li><li>Future Updates</li><li>Resources and GitHub Code</li></ol><blockquote>Let’s Start-</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kNee0H7n05l_g_4YnBy8eg.jpeg" /></figure><h3>1. What is Face Recognition-</h3><p>In simple words, identify individual faces / person’s face.</p><p>According to Wikipedia- A facial recognition system is a technology capable of identifying or verifying a person from a digital image or a video frame from a video source.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*rCBgdvugdgGWP8MXkPUfng.png" /><figcaption>Face Recognition</figcaption></figure><h3>2. What is Face Detection</h3><p>In simple words, detecting faces of humans. Detection doesn’t means recognition, only finding features of human face from image or video.</p><p>According to Wikipedia- Face detection is a computer technology being used in a variety of applications that identifies human faces in digital images. Face detection also refers to the psychological process by which humans locate and attend to faces in a visual scene.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*_8O3v9aI8goFLkdM3dBrTQ.jpeg" /><figcaption>Source: <a href="https://files.realpython.com/media/face-detection-abba.ea2dcc6d3bda.jpg">https://files.realpython.com/media/face-detection-abba.ea2dcc6d3bda.jpg</a></figcaption></figure><h3>3. Introduction of ‘auto-face-recognition’ python library</h3><p>It is the python library created by me, I want to reduce the complexity of this task, so that’s why I have created this library. Will talk about its working later.</p><p>You can check official Pypi page of this library here: <a href="https://pypi.org/project/auto-face-recognition/">https://pypi.org/project/auto-face-recognition/</a></p><p><strong><em>Install the latest version- </em></strong>pip install auto-face-recognition</p><p><strong><em>About auto-face-recognition</em></strong>: It is a python library for the Face Recognition. This library make face recognition easy and simple. This library uses Tensorflow 2.0+ for the face recognition and model training.</p><p><strong><em>Prerequisite</em></strong>- To use it only Python (&gt; 3.6) is required.</p><h3>4. How things works-</h3><p>Generally machine learning architecture follow few steps- data gathering, preprocessing, training, then prediction on unseen data with exported model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sH-BBQOMWrOwO7ozwgO7YQ.png" /><figcaption>ML Architecture</figcaption></figure><p>What if this <strong>data gathering, training and prediction</strong> can be done using few lines of code for Image Recoginition.</p><p>The answers is yes, its possible using <a href="https://pypi.org/project/auto-face-recognition/">auto-face-recognition</a>.</p><h3>5. Code-</h3><p>This is the complete code you need-</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4ace876b1dcd909e311cbdcf34299b30/href">https://medium.com/media/4ace876b1dcd909e311cbdcf34299b30/href</a></iframe><blockquote><strong><em>Explanation-</em></strong></blockquote><h4><strong>Import Libray-</strong></h4><pre><em>import </em>auto_face_recognition</pre><h4><strong>Create Object-</strong></h4><pre>obj = auto_face_recognition.AutoFaceRecognition()</pre><h4><strong>Create Dataset-</strong></h4><pre>obj.datasetcreate(haarcascade_path=&#39;haarcascade/haarcascade_frontalface_default.xml&#39;,<br>                  eyecascade_path=&#39;haarcascade/haarcascade_eye.xml&#39;,<br>                  class_name=&#39;Dipesh&#39;)</pre><p>This will create dataset for you. You need to pass these three params atleast-</p><p>:param <strong>class_name</strong>: str (example: ‘folder of class’)<br>:param <strong>haarcascade_path</strong>: str (example: haarcascade_frontalface_default.xml)hars<br>:param <strong>eyecascade_path</strong>: str (example: haarcascade_eye.xml)</p><p>haarcascade_frontalface_default.xml and haarcascade_eye.xml is the <a href="https://github.com/opencv/opencv/tree/master/data/haarcascades">opencv haarcascade</a> files. You need to place these files in your local storage and provide path to the params. <strong>class_name </strong>is the folder name you want to create.</p><p>A folder name ‘datasets/Dipesh’ will be created which contains training images-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9vS5GTn6lPpw6bgyeyaf7Q.png" /><figcaption>Image Recognition Dataset</figcaption></figure><p><em>Note- Create Atleast Two folder for the classification. One folder can be also trained but it doesn’t make any sense.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*tOwJDMqiUG7GlPlabRLapA.png" /><figcaption>Two folder of dataset</figcaption></figure><h4>Training-</h4><pre>obj.face_recognition_train()</pre><p>It will automatically start training, and it will automatically find path of dataset. If you canged the param of dataset dir in ‘datasetcreate’ function then change the dataset dir in ‘face_recognition_train’ accordingly. The default directory is ‘datasets’.</p><p><em>Training Summary-</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0569fe56cf4fe721e44b0cd4a108a78b/href">https://medium.com/media/0569fe56cf4fe721e44b0cd4a108a78b/href</a></iframe><p><em>This graphs will generated automatically-</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*LPp-S1bMx_ng4DC3eOMDwA.png" /><figcaption>Training Results</figcaption></figure><h4>Prediction-</h4><pre>obj.predict_faces(class_name=[&#39;Dipesh&#39;, &#39;Jay&#39;], color_mode=<em>True</em>)</pre><p>Here make sure to pass the class_name=[‘class_1’, ‘class2 ’]. You can chosse color_mode is True / Flase.</p><p>It will start recognizing your face-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*rCBgdvugdgGWP8MXkPUfng.png" /></figure><blockquote>Optional Parameter You Can Play Around-</blockquote><h4><strong><em>Parameters You Can Choose-</em></strong></h4><p><strong>datasetcreate()</strong></p><pre>datasetcreate(dataset_path=&#39;datasets&#39;, class_name=&#39;Demo&#39;,  <br>                  haarcascade_path=&#39;haarcascade/haarcascade_frontalface_default.xml&#39;,  <br>                  eyecascade_path=&#39;haarcascade/haarcascade_eye.xml&#39;, eye_detect=False,  <br>                  save_face_only=True, no_of_samples=100,  <br>                  width=128, height=128, color_mode=False)<br>&quot;&quot;&quot;&quot;                  <br>Dataset Create by face detection  <br>:param dataset_path: str (example: &#39;folder_of_dataset&#39;)<br>:param class_name: str (example: &#39;folder_of_dataset&#39;)<br>:param haarcascade_path: str (example: &#39;haarcascade_frontalface_default.xml)<br>:param eyecascade_path: str (example: &#39;haarcascade_eye.xml):param eye_detect: bool (example:True)<br>:param save_face_only: bool (example:True)<br>:param no_of_samples: int (example: 100)<br>:param width: int (example: 128)<br>:param height: int (example: 128)<br>:param color_mode: bool (example:False):return: None<br>&quot;&quot;&quot;</pre><p><strong>face_recognition_train()</strong></p><pre>face_recognition_train(data_dir=&#39;datasets&#39;, batch_size=32, img_height=128, img_width=128, epochs=10,  <br>                           model_path=&#39;model&#39;):  <br> &quot;&quot;&quot;  <br> Train TF Keras model according to dataset path  <br> :param data_dir: str (example: &#39;folder_of_dataset&#39;)  <br> :param batch_size: int (example:32)  <br> :param img_height: int (example:128)  <br> :param img_width: int (example:128)  <br> :param epochs: int (example:10)  <br> :param model_path: str (example: &#39;model&#39;)  <br> :return: None  <br> &quot;&quot;&quot;</pre><p><strong>predict_faces()</strong></p><pre>predict_faces(self, class_name=None, img_height=128, img_width=128,  <br>              haarcascade_path=&#39;haarcascade/haarcascade_frontalface_default.xml&#39;,  <br>              eyecascade_path=&#39;haarcascade/haarcascade_eye.xml&#39;, model_path=&#39;model&#39;,  <br>              color_mode=False):  <br> &quot;&quot;&quot;  <br> Predict Face  <br> :param class_name: Type-List (example: [&#39;class1&#39;, &#39;class2&#39;] )  <br> :param img_height: int (example:128)  <br> :param img_width: int (example:128)  <br> :param haarcascade_path: str (example: &#39;haarcascade_frontalface_default.xml)  <br> :param eyecascade_path: str (example: &#39;haarcascade_eye.xml)  <br> :param model_path: str (example: &#39;model&#39;)  <br> :param color_mode: bool (example: False)  <br> :return: None  <br> &quot;&quot;&quot;</pre><h3>6. Future-</h3><p><strong><em>Note- </em></strong>I haven’t gone through the stress test, like maximum number of classes.</p><p>Finetuning, custom models and your suggestions.</p><p>Follow me here or <a href="https://www.youtube.com/DIPESHPAL17">YouTube</a> or <a href="https://www.instagram.com/dipesh_pal17/">Instagram</a> for future updates.</p><h3>7. Resources and GitHub Code-</h3><p><strong>Pipy:</strong> <a href="https://pypi.org/project/auto-face-recognition/">https://pypi.org/project/auto-face-recognition/</a></p><p><strong>Github:</strong> <a href="https://gist.github.com/Dipeshpal/ed0431234f1c8873249cfdd5f4dc88e4.js">https://gist.github.com/Dipeshpal/ed0431234f1c8873249cfdd5f4dc88e4</a></p><p><strong>YouTube:</strong> <a href="https://www.youtube.com/DIPESHPAL17">https://www.youtube.com/DIPESHPAL17</a></p><p><strong>YouTube Face Recognition Demo:</strong> <a href="https://youtu.be/EU0LHtEJTnE">https://youtu.be/EU0LHtEJTnE</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39a5bf798267" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/face-recognition-with-python-and-deep-learning-in-5-lines-5-minutes-39a5bf798267">Face Recognition with Python and Deep Learning in 5 Lines 5 Minutes</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>