<?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 The Simple Learning on Medium]]></title>
        <description><![CDATA[Stories by The Simple Learning on Medium]]></description>
        <link>https://medium.com/@thesimplelearning?source=rss-b464adfc5850------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YZK3F6M1OrZ8pfUz0Pb3uQ.png</url>
            <title>Stories by The Simple Learning on Medium</title>
            <link>https://medium.com/@thesimplelearning?source=rss-b464adfc5850------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 00:30:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@thesimplelearning/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[Document Your Code]]></title>
            <link>https://medium.com/@thesimplelearning/document-your-code-2852973b3d17?source=rss-b464adfc5850------2</link>
            <guid isPermaLink="false">https://medium.com/p/2852973b3d17</guid>
            <category><![CDATA[pep257]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[docstring]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[pep8]]></category>
            <dc:creator><![CDATA[The Simple Learning]]></dc:creator>
            <pubDate>Mon, 11 Mar 2024 15:51:06 GMT</pubDate>
            <atom:updated>2024-03-11T15:51:06.649Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rxahclrxl7eS3DvKxgB7pg.png" /></figure><p>It’s like putting labels on different parts of a Lego set so you remember how to build it later. It helps other people understand your code better, like reading a storybook with pictures and words. Just like following a recipe when baking cookies, documenting your code makes it easier to share and understand how everything works together.</p><h3>Best Practices for Code Documentation:</h3><ol><li><strong>Use Descriptive Variable and Function Names:</strong></li></ol><ul><li>Choose meaningful and descriptive names for variables, functions, and classes to convey their purpose and functionality.</li></ul><p><strong>2. Write Clear Comments:</strong></p><ul><li>Include comments throughout the code to explain complex logic, algorithms, or any non-obvious functionality.</li><li>Use comments to document the intent behind specific code blocks or sections.</li></ul><p><strong>3. Document Function Signatures:</strong></p><ul><li>Provide clear documentation for function signatures, including parameters, return types, and any exceptions raised.</li><li>Use docstrings to document functions, classes, and modules in Python.</li></ul><p><strong>4. Include Examples and Usage Patterns:</strong></p><ul><li>Provide usage examples and usage patterns in docstrings to illustrate how to use the function or class effectively.</li></ul><p><strong>5. Update Documentation Regularly:</strong></p><ul><li>Keep the documentation up-to-date with any changes or enhancements made to the codebase.</li><li>Review and update documentation during code reviews and refactorings.</li></ul><p><strong>For Python PEP 257 is defined Docstring Conventions. Which Suggest:</strong></p><ol><li><strong>One-Line Docstrings:</strong></li></ol><ul><li>For simple functions or methods, a one-line docstring should be used. It should be enclosed in triple quotes (<strong>&quot;&quot;&quot;</strong>) and placed immediately after the function or method definition.</li></ul><pre>def my_function(arg):<br>    &quot;&quot;&quot;One-line docstring.&quot;&quot;&quot;<br>    # Function body</pre><p>2. Multi-Line Docstrings:</p><ul><li>For more complex functions or methods, multi-line docstrings are recommended. They should consist of a one-line summary followed by a blank line and a more detailed description.</li></ul><pre>def my_function(arg):<br>    &quot;&quot;&quot;<br>    Summary line.<br><br>    Detailed description of the function.<br>    More details can be provided here.<br>    &quot;&quot;&quot;<br>    # Function body</pre><p>3. <strong>Docstring Content:</strong></p><ul><li>Docstrings should describe what the function or method does, including its purpose, arguments (if any), return values (if any), and any exceptions raised.</li><li>It should provide enough information for users to understand how to use the function or method correctly.</li></ul><p><strong>4. Quotes Style:</strong></p><ul><li>Docstrings should use triple quotes (<strong>&quot;&quot;&quot;</strong>) for consistency and to support multi-line strings.</li></ul><p><strong>5. Whitespace:</strong></p><ul><li>Use a blank line before and after the docstring to separate it from the rest of the code for clarity.</li></ul><p><strong>6. Docstring Location:</strong></p><ul><li>Docstrings should be placed immediately after the function, method, class, or module definition.</li></ul><p><strong>7. Punctuation:</strong></p><ul><li>Use proper punctuation and grammar in docstrings to ensure clarity and readability.</li></ul><p>By following these best practices and understanding the benefits of code documentation, developers can contribute to building maintainable, robust, and collaborative codebases in Python.</p><p>Do like, comment, follow and share.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2852973b3d17" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Keep Code Dry (Don’t Repeat Yourself)]]></title>
            <link>https://medium.com/@thesimplelearning/keep-code-dry-dont-repeat-yourself-45828f69d10a?source=rss-b464adfc5850------2</link>
            <guid isPermaLink="false">https://medium.com/p/45828f69d10a</guid>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[programming-tips]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[The Simple Learning]]></dc:creator>
            <pubDate>Mon, 26 Feb 2024 15:55:49 GMT</pubDate>
            <atom:updated>2024-02-26T15:55:49.512Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Bytebeat, Keep Code Dry (Don’t Repeat Yourself)" src="https://cdn-images-1.medium.com/max/1024/1*wOOAceWtEabZQ3OwYabqgg.png" /></figure><h3>Imagine you’re baking cookies. Instead of writing out the recipe multiple times for different types of cookies, you create a master recipe with common ingredients and variations for different flavors (chocolate chip, oatmeal raisin, etc.). This way, you avoid repeating the same steps and ingredients, making the baking process more efficient and organized.</h3><p>That’s what “Keep Code DRY” is all about in programming. DRY stands for “Don’t Repeat Yourself.” It means that instead of writing the same code over and over again, you should find ways to reuse code that does the same thing.</p><p>Here’s why it’s important:</p><ol><li><strong>Saves Time:</strong> Writing the same code multiple times takes longer. By keeping your code DRY, you can write less code and get more done in less time.</li><li><strong>Easier to Maintain:</strong> If you ever need to change something in your code, you only have to do it in one place. With repeated code, you’d have to make the same change in multiple places, which is a hassle and increases the chances of making mistakes.</li><li><strong>Improves Readability:</strong> When you see the same code repeated, it can be confusing. Keeping your code DRY makes it easier for you and others to understand what’s going on.</li></ol><p>So, here’s some advice for you:</p><ul><li><strong>Identify Patterns:</strong> Look for places in your code where you’re doing the same thing over and over again. These are opportunities to keep your code DRY.</li><li><strong>Use Functions:</strong> If you find yourself writing the same block of code multiple times, consider putting that code inside a function. Then, you can call that function whenever you need to perform that task.</li><li><strong>Modularize Your Code:</strong> Break your code into smaller, reusable modules. This allows you to separate different functionalities and reuse them across your project.</li><li><strong>Don’t Reinvent the Wheel:</strong> If there’s a library or built-in function that does what you need, use it! There’s no need to write code from scratch if someone else has already done the hard work for you.</li></ul><p>By keeping your code DRY, you’ll write cleaner, more efficient code that’s easier to maintain and understand. It’s like building a LEGO castle with fewer pieces but still making it just as awesome!</p><p>Follow <a href="https://twitter.com/TSimpleLearning">https://twitter.com/TSimpleLearning</a></p><p>Like <a href="https://www.facebook.com/thesimplelearning562">https://www.facebook.com/thesimplelearning562</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45828f69d10a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Practice Debugging Skills — ByteBeat Bulletin]]></title>
            <link>https://medium.com/@thesimplelearning/practice-debugging-skills-bytebeat-bulletin-cd4457d36e4b?source=rss-b464adfc5850------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd4457d36e4b</guid>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[debugging-tips]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[profiling]]></category>
            <dc:creator><![CDATA[The Simple Learning]]></dc:creator>
            <pubDate>Sun, 11 Feb 2024 16:41:16 GMT</pubDate>
            <atom:updated>2024-02-11T16:41:16.666Z</atom:updated>
            <content:encoded><![CDATA[<h3>Practice Debugging Skills — ByteBeat Bulletin</h3><p>Debugging is an essential skill for every programmer. Learn how to effectively troubleshoot and identify errors in your code. Tools like print statements and logging can be invaluable for this.</p><figure><img alt="Practice debugging skills- Thesimplelearning python" src="https://cdn-images-1.medium.com/max/1024/1*qYsNjeCu5V_i7wBCstvxsw.png" /></figure><p>Here are some for python:</p><ol><li>Print Statement<br> One of the simplest and most commonly used debugging techniques in Python is inserting print statements into your code</li><li>Debugger(pdb)<br> Python’s built-in debugger, pdb (Python Debugger), allows you to step through your code line by line, inspecting variables and evaluating expressions at each step. You can set breakpoints, examine the call stack, and interactively debug your code</li><li>Logging<br> By strategically placing logging statements throughout your code, you can gather information about the program’s behavior and identify potential issues.</li><li>Exception Handling<br> Use try-except blocks to catch and handle exceptions gracefully.</li><li>Unit Testing<br> Unit tests help you verify the correctness of individual components of your code and catch bugs early in the development process. Pytest or unitest are inbuilt testing module.</li><li>Profiling<br> If your code is running slowly or consuming too much memory, profiling tools can help you identify the problem areas. They allow you to see which parts of your code are consuming the most resources, which can be invaluable in optimizing your code.</li></ol><p>Other options to consider:</p><ol><li>Code Review</li></ol><p>Having a second pair of eyes look over your code can help you spot potential bugs and areas for improvement that you might have missed. This can be done informally with a colleague or through a formal code review process.</p><p>2. Static Code Analysis</p><p>Static code analysis tools can help you catch potential bugs and maintain code quality by analyzing your code without running it. They can spot common coding mistakes, adherence to coding standards, and even some types of security vulnerabilities.</p><p>3. Continuous Integration</p><p>Continuous Integration (CI) is a development practice where developers integrate code into a shared repository frequently, preferably several times a day. Each integration can then be verified by an automated build and automated tests. CI can help catch bugs early and minimize the cost of fixing them.</p><p>4. Pair Programming</p><p>Pair programming involves two developers working on the same codebase simultaneously. This can help catch bugs early, as the “observer” can spot potential issues as the “driver” writes the code. It also encourages knowledge sharing and can improve the overall quality of the code.</p><p>#python</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd4457d36e4b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An overview of the GPT-3 model and its capabilities]]></title>
            <link>https://medium.com/@thesimplelearning/an-overview-of-the-gpt-3-model-and-its-capabilities-50b759d2bb60?source=rss-b464adfc5850------2</link>
            <guid isPermaLink="false">https://medium.com/p/50b759d2bb60</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[The Simple Learning]]></dc:creator>
            <pubDate>Thu, 09 Feb 2023 18:34:02 GMT</pubDate>
            <atom:updated>2023-02-09T18:34:02.753Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*miYp1Z5ZNFHb6jL8" /><figcaption>Photo by <a href="https://unsplash.com/@jupp?utm_source=medium&amp;utm_medium=referral">Jonathan Kemper</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>OpenAI’s GPT-3 (Generative Pretrained Transformer-3) is one of the most advanced and capable artificial intelligence models to date. In this article, we will provide an overview of the GPT-3 model and its capabilities.</p><p>GPT-3 is a deep learning-based language model that has been trained on a massive dataset of text from the internet. This training allows the model to generate text that is coherent and relevant to a given prompt, making it an incredibly versatile and capable tool for a wide range of applications.</p><p>One of the key strengths of GPT-3 is its ability to generate high-quality text. The model can <em>write articles, stories, and poems</em> that are indistinguishable from those written by humans. It can also translate text, summarize articles, and answer questions with remarkable accuracy. <strong>This makes GPT-3 a valuable tool for tasks such as language translation, content creation, and information retrieval</strong>.</p><p>In addition to its text generation capabilities, GPT-3 is also capable of performing a wide range of other NLP (Natural Language Processing) tasks. For example, the model can identify the named entities in a text, recognize relationships between entities, and classify text into different categories. These capabilities make GPT-3 a valuable tool for tasks such as <strong>sentiment analysis, text classification, and named entity recognition.</strong></p><p>Another impressive feature of GPT-3 is its ability to learn from examples and perform <strong>zero-shot learning</strong>. This means that the model can perform a new task without being specifically trained on that task, simply by being given a few examples. For example, GPT-3 can perform arithmetic calculations, generate code in various programming languages, and answer trivia questions, all without being specifically trained on these tasks.</p><p>Finally, GPT-3 is also notable for its <strong>ability to understand and generate code</strong>. The model can generate code snippets in a variety of programming languages and can even complete code snippets that are partially written. This makes GPT-3 a valuable tool for software development, as it can automate many routine tasks and reduce the time and effort required to complete projects.</p><p>In conclusion, OpenAI’s GPT-3 is an incredibly advanced and capable model that has the potential to revolutionize many different industries and applications. Its ability to generate high-quality text, perform a wide range of NLP tasks, learn from examples, and understand and generate code make it a valuable tool for tasks ranging from content creation and information retrieval to software development and beyond. <strong>As the field of AI continues to advance, it will be exciting to see how GPT-3 and other models like it will be used to improve and simplify our lives.</strong></p><p>What is your use-case of Chat-GPT? Comment and let us know.</p><p><em>Originally published at </em><a href="https://www.thesimplelearning.com/2023/01/an-overview-of-gpt-3-model-and-its.html"><em>https://www.thesimplelearning.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50b759d2bb60" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Git — part one]]></title>
            <link>https://medium.com/@thesimplelearning/getting-started-with-git-part-one-b3959e389b48?source=rss-b464adfc5850------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3959e389b48</guid>
            <category><![CDATA[gitlab]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[The Simple Learning]]></dc:creator>
            <pubDate>Sun, 05 Feb 2023 09:47:24 GMT</pubDate>
            <atom:updated>2023-02-05T09:47:24.448Z</atom:updated>
            <content:encoded><![CDATA[<h3>Getting Started with Git — part one</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rOg7hp_YiTVq6iQ-" /><figcaption>Photo by <a href="https://unsplash.com/@synkevych?utm_source=medium&amp;utm_medium=referral">Roman Synkevych 🇺🇦</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Git is a version control system that allows you to track changes to your code and collaborate with others on software development projects. Here are the basic steps to get started with Git:</p><ol><li>Install Git on your computer. You can download the latest version of Git from the official website (<a href="https://git-scm.com/downloads"><strong>https://git-scm.com/downloads</strong></a>).</li><li>Open a command line or terminal window and navigate to the folder where you want to create your Git repository.</li><li>Use the <strong>git init</strong> command to initialize a new repository in the current folder. This command creates a new subfolder called &quot;.git&quot; that contains the necessary files for the repository.</li><li>Use the command to stage the files that you want to include in the next commit. For example, <strong>git add file1.txt</strong> will stage the file &quot;file1.txt&quot; for the next commit.</li><li>Use the command to save the staged changes to the repository. The option allows you to add a message describing the changes. For example, <strong>git commit -m &quot;Initial commit&quot;</strong> will create the first commit with the message &quot;Initial commit&quot;.</li><li>Use the <strong>git status</strong> command to check the current status of the repository. This command will show which files have been modified, which files have been staged for the next commit, and which branch you are currently working on.</li><li>Use the <strong>git log</strong> command to see a list of all commits in the repository, along with their corresponding messages.</li><li>Use the command to manage branches in your repository. You can use to list existing branches, <strong>git branch newbranch</strong> to create a new branch, and <strong>git checkout branch</strong> to switch to a different branch.</li><li>Finally, the(ex <strong>git push origin main</strong>) command to push the changes to remote repository.</li></ol><p>These are the basic steps to get started with Git. <strong>As you become more familiar with Git, you can start using more advanced features such as branching, merging, and working with remote repositories</strong>.</p><p>It’s important to note that Git is distributed version control system so you can work on a local repository and then push/pull changes to a remote repository. Most developers use<strong> Github, Gitlab, and Bitbucket </strong>as remote repositories.</p><p>Do comment if you’re facing any issue on git.</p><p><em>Originally published at </em><a href="https://www.thesimplelearning.com/2021/04/getting-started-with-git-part-one.html"><em>https://www.thesimplelearning.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3959e389b48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Tips and Tricks for Beginners — Part 1]]></title>
            <link>https://medium.com/@thesimplelearning/python-tips-and-tricks-for-beginners-part-1-3714e88ad68f?source=rss-b464adfc5850------2</link>
            <guid isPermaLink="false">https://medium.com/p/3714e88ad68f</guid>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[The Simple Learning]]></dc:creator>
            <pubDate>Sun, 22 Jan 2023 13:46:58 GMT</pubDate>
            <atom:updated>2023-01-22T13:46:58.919Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python Tips and Tricks for Beginners — Part 1</h3><figure><img alt="Python Tips and Tricks for Beginners" src="https://cdn-images-1.medium.com/max/1024/0*uAxIuVIHmNrJc5yM" /><figcaption>Photo by <a href="https://unsplash.com/@arielbesagar?utm_source=medium&amp;utm_medium=referral">Ariel</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Here are a few tips and tricks for Python beginners:</h4><ol><li>Use<strong> list comprehensions</strong> instead of for loops: List comprehensions are a concise way to create lists and are often faster than for loops.</li></ol><p>They have the syntax:<em> [expression for item in iter-able if condition]. </em>Example</p><pre>original_list = [1, 2, 3, 4, 5]<br>squared_list = [x**2 for x in original_list]<br>print(squared_list)</pre><pre>[1, 4, 9, 16, 25]</pre><p>2. Use the <strong>“with” statement when working with files</strong>: The “with” statement is used when working with files and automatically takes care of closing the file after it’s been used. This eliminates the need to explicitly call the close() method and can help prevent errors.</p><pre>with open(&#39;example.txt&#39;, &#39;r&#39;) as file:<br>    contents = file.read()<br>    print(contents)</pre><p>Once the code inside the <strong>with</strong> <strong>block</strong> is finished executing, the file will automatically be closed. This ensures that the file is closed even if an exception is raised inside the <strong>with block</strong>. The same can be used when writing to a file.</p><p>3. Use the<strong> built-in</strong> function <strong>enumerate</strong>(): The enumerate() function is used to loop over a list while keeping track of the index of the current item. It returns both the index and the value of the current item.</p><pre>fruits = [&#39;apple&#39;, &#39;banana&#39;, &#39;orange&#39;]<br>for index, value in enumerate(fruits):<br>    print(f&quot;{index}: {value}&quot;)<br><br># output<br>0: apple<br>1: banana<br>2: orange</pre><p>4. Use the <strong>ternary operator for simple if-else</strong> statements: The ternary operator allows you to write simple if-else statements in a single line of code. The syntax is: value_if_true if condition else value_if_false.</p><pre>value_if_true if condition else value_if_false.</pre><p>Example</p><pre>x = 10<br>y = 20<br><br>bigger = x if x &gt; y else y<br>print(bigger)<br><br># output<br>20</pre><p>A more complex example:</p><pre>age = 20<br>status = &quot;minor&quot; if age &lt; 18 else &quot;adult&quot; if age &lt; 65 else &quot;senior&quot;<br>print(status)<br><br>#output<br>adult</pre><p>5. Get familiar with modules and packages: Python has a large number of modules and packages, many of which are designed to perform specific tasks. It is important to familiarize yourself with the available modules and packages and to use the ones that are appropriate for your task. some of the modules for example:</p><blockquote>a. random</blockquote><blockquote>b. os</blockquote><blockquote>c. DateTime and time</blockquote><blockquote>d. json</blockquote><p>6. Get into the habit of <strong>writing documentation</strong>: Good documentation is essential for any code you write. This is even more important for beginners, who are still learning the best practices for writing code.</p><p>7. <strong>Practice and practice, write more code</strong>, and get yourself involved in open-source projects that will help you to improve your skills.</p><p>8. Make use of Python Tutors and Mentors, who can guide and help you to overcome any issues you face while learning.</p><p>9. Get any function doc string in python shell buy adding “<strong>?”</strong> at last and press enter. Example</p><pre>sum?</pre><p>output:</p><pre>Signature: sum(iterable, /, start=0)<br>Docstring:<br>Return the sum of a &#39;start&#39; value (default: 0) plus an iterable of numbers<br><br>When the iterable is empty, return the start value.<br>This function is intended specifically for use with numeric values and may<br>reject non-numeric types.<br>Type:      builtin_function_or_method</pre><p>By implementing these tips and tricks, you can write more efficient and readable Python code, and also it will help you to improve your coding skills.</p><blockquote>Do check out Python’s official documentation time to time.</blockquote><p><em>Originally published at </em><a href="https://www.thesimplelearning.com/2021/02/python-tips-and-tricks-for-beginners.html"><em>https://www.thesimplelearning.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3714e88ad68f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python’s Inbuilt Modules to Make Life Easier]]></title>
            <link>https://medium.com/@thesimplelearning/pythons-inbuilt-modules-to-make-life-easier-77425d38c226?source=rss-b464adfc5850------2</link>
            <guid isPermaLink="false">https://medium.com/p/77425d38c226</guid>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[modules]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[The Simple Learning]]></dc:creator>
            <pubDate>Sun, 22 Jan 2023 13:03:34 GMT</pubDate>
            <atom:updated>2023-01-22T13:03:34.268Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Python’s Inbuilt Modules to Make Life Easier" src="https://cdn-images-1.medium.com/max/1024/0*Ftc9HlID4Y3Kq6_n" /><figcaption>Photo by <a href="https://unsplash.com/@ralexnder?utm_source=medium&amp;utm_medium=referral">Alex Chumak</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Python has a number of built-in modules and packages that are included with the standard distribution. Here are some popular ones:</p><ol><li><strong>math</strong>: A module that provides mathematical functions and constants, such as trigonometric functions, logarithms, and the constant pi.</li><li><strong>random</strong>: A module that provides various random number generators and probability distributions.</li><li><strong>os</strong>: A module that provides a way to interact with the operating system, such as navigating the file system, creating and removing directories, and executing shell commands.</li><li><strong>time</strong>: A module that provides functions for working with time and dates, such as measuring time intervals and parsing and formatting date and time strings.</li><li><strong>datetime</strong>: A module that provides classes for working with dates and times, such as date, time, <strong>datetime</strong>, <strong>timedelta</strong>, etc.</li><li><strong>json</strong>: A module for working with JSON data, it provides functions for encoding and decoding JSON data.</li><li><strong>re</strong> : A module that provides regular expression matching operations.</li><li><strong>sys</strong>: A module that provides access to some variables and functions that are used or maintained by the Python interpreter, such as the command-line arguments passed to a script.</li><li><strong>statistics</strong>: A module for mathematical statistics functions, like mean, median, variance and etc.</li><li><strong>sys</strong>: A module that provides access to system-specific parameters and functions, like interpreter version, command line arguments and etc.</li><li><strong>urllib</strong> : A module that provides an API for using the basic HTTP and FTP protocols, it also used for opening and reading URLs.</li><li><strong>argparse</strong> : A module that makes it easy to write user-friendly command-line interfaces.</li></ol><p>These are just a few examples of the built-in modules and packages available in Python. Each of them provides a specific set of functionalities that can be used to solve different problems.</p><p><strong>Do comment your favorite module.</strong></p><p><em>Originally published at </em><a href="https://www.thesimplelearning.com/2021/02/python-inbuilt-modules-beginner.html"><em>https://www.thesimplelearning.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77425d38c226" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Linux command line]]></title>
            <link>https://medium.com/@thesimplelearning/getting-started-with-linux-command-line-f7302f9e10c4?source=rss-b464adfc5850------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7302f9e10c4</guid>
            <category><![CDATA[terminal]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[command-line-interface]]></category>
            <dc:creator><![CDATA[The Simple Learning]]></dc:creator>
            <pubDate>Sun, 22 Jan 2023 12:52:29 GMT</pubDate>
            <atom:updated>2023-01-22T12:52:29.917Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Getting Started with Linux command line" src="https://cdn-images-1.medium.com/max/1024/0*ULuSktij7hfvEYrk" /><figcaption>Photo by <a href="https://unsplash.com/@anagani_saikiran?utm_source=medium&amp;utm_medium=referral">Sai Kiran Anagani</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>The Linux command line is a powerful tool for interacting with your computer and performing various tasks. Here are the basic steps to get started with the Linux command line:</p><ol><li>Open a terminal window. On most Linux distributions, you can open the terminal by pressing the key combination <strong>Ctrl + Alt + T</strong>.</li><li>Use the <strong>ls</strong> command to list the files and directories in the current directory.</li></ol><pre>ls</pre><p>3. Use the <strong>cd</strong> command to change the current directory. For example, to change to the home directory, you would use the command:</p><pre>cd /home/ubuntu/</pre><p>4. Use the <strong>pwd</strong> command to display the current working directory.</p><pre>pwd</pre><p>5. Use the <strong>mkdir</strong> command to create a new directory. For example, to create a new directory called &quot;myfolder&quot;, you would use the command:</p><pre>mkdir myfolder</pre><p>6. Use the <strong>touch</strong> command to create a new empty file. For example, to create a new file called &quot;myfile.txt&quot;, you would use the command:</p><pre>touch myfile.txt</pre><p>7. Use the <strong>rm</strong> command to delete a file or directory. For example, to delete the file &quot;myfile.txt&quot;, you would use the command: <strong>(run this carefully)</strong></p><pre>rm myfile.txt</pre><p>8. Use the <strong>cp</strong> command to copy a file or directory. For example, to copy the file &quot;myfile.txt&quot; to a new file called &quot;myfile_backup.txt&quot;, you would use the command:</p><pre>cp myfile.txt myfile_backup.txt</pre><p>9. Use the <strong>mv</strong> command to move or rename a file or directory. For example, to rename the file &quot;myfile.txt&quot; to &quot;mynewfile.txt&quot;, you would use the command:</p><pre>mv myfile.txt mynewfile.txt</pre><p>Other:</p><ol><li>“<strong>cat</strong>” — Displays the contents of a file.</li><li>“<strong>grep</strong>” — Searches for a specific string in a file or multiple files.</li><li>“<strong>find</strong>” — Searches for files based on various criteria such as name, size, and time modified.</li><li>“<strong>man</strong>” — Displays the manual pages for a command.</li><li>“<strong>chmod</strong>” — Changes the permissions of a file or directory.</li><li>“<strong>sudo</strong>” — Allows a user to run a command with administrative privileges.</li></ol><p>These are just a few basic examples of how to use the Linux command line. There are many more commands and options available, and it’s worth exploring and learning more about the command line.</p><p><strong><em>It’s important to note that the command line uses case-sensitive</em>, so be careful of </strong>the case when you type the command.</p><p><em>Originally published at </em><a href="https://www.thesimplelearning.com/2021/04/linux-command-line-basic.html"><em>https://www.thesimplelearning.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7302f9e10c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python strptime() vs Python strftime()]]></title>
            <link>https://medium.com/@thesimplelearning/python-strptime-vs-python-strftime-4af7ea1596f8?source=rss-b464adfc5850------2</link>
            <guid isPermaLink="false">https://medium.com/p/4af7ea1596f8</guid>
            <category><![CDATA[strftime]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[datetime]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[The Simple Learning]]></dc:creator>
            <pubDate>Sun, 22 Jan 2023 12:45:29 GMT</pubDate>
            <atom:updated>2023-01-22T12:45:29.395Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Python strptime() vs Python strftime()" src="https://cdn-images-1.medium.com/max/1024/0*GXgdhj1sgH71UF32" /><figcaption>Photo by <a href="https://unsplash.com/@fabiraw?utm_source=medium&amp;utm_medium=referral">Fabian Albert</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>The strftime() method <strong>returns a string representing date and time</strong> using date , time or datetime object. So it is used to convert the date-time object into string format.</p><p>Let’s take a look at an example:</p><pre>from datetime import datetime<br>t = datetime.now()<br>print(&#39;current-time---&gt;&#39;, t)<br>#output<br>current-time---&gt; 2023-01-10 23:16:42.511274<br><br>#now let&#39;s play around strftime<br>print(t.strftime(&#39;%y-%m-%d&#39;))<br>output:--&gt; 23-01-10<br>print(t.strftime(&#39;%Y-%m-%d&#39;))<br>output:--&gt; 2023-01-10<br>print(t.strftime(&#39;%y-%m-%d %H:%M&#39;))<br>output:--&gt; 23-01-10 23:16</pre><p>So basically we can extract any kind of data from date-time object in string format.</p><p>The strptime() method <strong>creates a datetime object from the given string</strong>. It used to convert a given string into python datetime object.</p><p>In the same way, let’s look at an example for <strong>strptime</strong>.</p><pre>from datetime import datetime<br>t_date = &#39;2023-01-10&#39;<br>t_date_obj = datetime.strptime(t_date, &#39;%Y-%m-%d&#39;)<br>output:--&gt;<br>datetime.datetime(2023, 1, 10, 0, 0)<br># lets add a time as well.<br>t_date_time = &#39;2023-01-10T10:10&#39;<br>t_date_time_obj = datetime.strptime(t_date, &#39;%Y-%m-%dT%H:%M&#39;)<br>output:--&gt;<br>datetime.datetime(2023, 1, 10, 10, 10)</pre><p>It’s really helpful in time formatting, ingesting data in different time format, date-to-string conversion etc.</p><p>Do check out the official python documentation for the full list of abbreviations.</p><p><a href="https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior">https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior</a></p><p><em>Originally published at </em><a href="https://www.thesimplelearning.com/2021/03/python-strptime-vs-python-strftime.html"><em>https://www.thesimplelearning.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4af7ea1596f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Debugging Techniques for Beginners]]></title>
            <link>https://medium.com/@thesimplelearning/python-debugging-techniques-for-beginners-c688c0071643?source=rss-b464adfc5850------2</link>
            <guid isPermaLink="false">https://medium.com/p/c688c0071643</guid>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[The Simple Learning]]></dc:creator>
            <pubDate>Sun, 22 Jan 2023 12:36:46 GMT</pubDate>
            <atom:updated>2023-01-22T12:36:46.478Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*B48Kmm2MAOXxDgyq" /><figcaption>Photo by <a href="https://unsplash.com/@nublson?utm_source=medium&amp;utm_medium=referral">Nubelson Fernandes</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Debugging is an important part of the software development process, and Python provides several techniques for beginners to debug their code. Here are some common techniques:</p><ol><li><strong>Print statements</strong>: One of the simplest and most widely used techniques is to insert statements in your code to check the values of variables and expressions at different points in the execution. This can help you identify where the problem is occurring and what the state of the program is at that point.</li><li><strong>The </strong><strong>pdb library</strong>: Python includes a built-in library called that provides a command-line interface for debugging. You can insert the statement <strong>import pdb; pdb.set_trace()</strong> at the point where you want to start debugging, and the program will enter the interactive mode, allowing you to step through the code and inspect variables.</li><li><strong>The </strong><strong>ipdb library</strong>: is an improved version of library, it allows you to use the same interface as but with some added features like syntax highlighting and tab completion.</li><li><strong>The </strong><strong>breakpoint() function</strong>: Python 3.7 introduces a built-in function <strong>breakpoint()</strong> that is similar to <strong>pdb.set_trace()</strong> but it does not require importing pdb, it is built-in to the interpreter.</li><li><strong>IDEs and text editors with debugging support</strong>: Many IDEs and text editors have built-in support for debugging Python code, such as <em>PyCharm</em>, <em>VSCode</em>, and <em>Sublime Text</em>. These tools provide a graphical user interface that allows you to set breakpoints, step through code, and inspect variables.</li><li><strong>Assert statements</strong>: Using assert statements you can check if a certain condition is true during runtime and if it isn’t it will raise an <em>AssertionError</em>, you can use this to check if the code is working as expected.</li><li><strong>logging</strong>: Logging is a way to record information about your code&#39;s execution. It can be used to record messages that can help you understand what is happening in your code.</li><li><strong>try-except</strong> block: Using try-except blocks to catch and handle specific errors, can help you isolate and fix the issue, and also can provide the user with a meaningful message.</li></ol><p>While debugging can be a frustrating process, these techniques can help you quickly identify and fix errors in your code, allowing you to move on to the next step in your development process. It’s important to try different techniques to find the one that works best for you and your specific needs.</p><p><strong>Do Comment what’s your favorite?</strong></p><p><em>Originally published at </em><a href="https://www.thesimplelearning.com/2021/03/python-debugging-techniques.html"><em>https://www.thesimplelearning.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c688c0071643" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>