<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lancelot03</title>
    <description>The latest articles on DEV Community by Lancelot03 (@lancelot03).</description>
    <link>https://dev.to/lancelot03</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F747866%2F13c1fea6-9f79-437b-859d-3e61ca4c26aa.jpeg</url>
      <title>DEV Community: Lancelot03</title>
      <link>https://dev.to/lancelot03</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lancelot03"/>
    <language>en</language>
    <item>
      <title>An Introduction to System Design: Creating Efficient and Effective Solutions</title>
      <dc:creator>Lancelot03</dc:creator>
      <pubDate>Sat, 06 May 2023 16:57:52 +0000</pubDate>
      <link>https://dev.to/lancelot03/an-introduction-to-system-design-creating-efficient-and-effective-solutions-1cbl</link>
      <guid>https://dev.to/lancelot03/an-introduction-to-system-design-creating-efficient-and-effective-solutions-1cbl</guid>
      <description>&lt;p&gt;System design is the process of creating a plan or blueprint for building an efficient and effective system that can accomplish a specific set of goals. This process involves defining the system's architecture, components, modules, interfaces, and data flows, as well as determining how the system will be implemented, tested, and maintained.&lt;/p&gt;

&lt;p&gt;System design is a critical step in the software development process, as it sets the foundation for the system's development, testing, and deployment. A well-designed system can save time and money, improve performance and scalability, and enhance the user experience.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aMXV_Ewj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w5dods5fsfc8rk7jiwyq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aMXV_Ewj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w5dods5fsfc8rk7jiwyq.png" alt="Image description" width="283" height="178"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The system design process typically involves the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Requirements gathering: The first step in system design is to gather and analyze the requirements for the system. This involves understanding the business or user needs that the system is intended to address and identifying the key features and functionality that the system must deliver.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Architecture design: The next step is to create the overall architecture of the system. This involves defining the system's structure, including its components, modules, interfaces, and data flows. The architecture should be designed to meet the requirements identified in step one.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Component design: The third step is to design the individual components of the system. This involves defining the functionality of each component and determining how they will interact with other components in the system.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Interface design: The fourth step is to design the interfaces between the system components. This includes defining the data exchange protocols, communication channels, and other interface details.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Testing and verification: The final step is to test and verify the system design to ensure that it meets the requirements and performs as expected. This may involve creating test cases, running simulations, and conducting user testing.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;System design is an iterative process, and each step may require multiple iterations before the design is finalized. Throughout the design process, it is important to consider factors such as performance, scalability, maintainability, security, and usability.&lt;/p&gt;

&lt;p&gt;In conclusion, system design is a critical step in the software development process that involves creating a plan or blueprint for building an efficient and effective system. By following a structured design process and considering key factors such as performance and usability, developers can create systems that meet the needs of users and businesses while minimizing costs and maximizing benefits.&lt;/p&gt;

</description>
      <category>systemdesign</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>devops</category>
    </item>
    <item>
      <title>Introduction to DevOps</title>
      <dc:creator>Lancelot03</dc:creator>
      <pubDate>Wed, 03 May 2023 18:26:45 +0000</pubDate>
      <link>https://dev.to/lancelot03/introduction-to-devops-nid</link>
      <guid>https://dev.to/lancelot03/introduction-to-devops-nid</guid>
      <description>&lt;p&gt;DevOps is a set of practices that combines software development and IT operations to improve the speed, quality, and reliability of software delivery. DevOps is not just a set of tools or technologies, but a cultural shift that emphasizes collaboration, communication, and automation between software development and IT operations teams. In this article, we will provide an introduction to DevOps concepts, practices, and tools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;DevOps Concepts&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2NkWF3qE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vatne9l1yqleox5v7660.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2NkWF3qE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vatne9l1yqleox5v7660.jpeg" alt="Image description" width="200" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;DevOps is based on a set of key principles that aim to break down the silos between software development and IT operations teams. Some of the key DevOps concepts include:&lt;br&gt;
Collaboration and Communication: DevOps emphasizes collaboration and communication between development and operations teams, breaking down traditional silos and enabling teams to work together more effectively.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Automation: DevOps relies heavily on automation to streamline processes and eliminate manual tasks. Automation helps to reduce errors, improve efficiency, and speed up software delivery.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Continuous Integration and Continuous Deployment: DevOps promotes the use of continuous integration and continuous deployment (CI/CD) practices to automate the software delivery process. CI/CD allows developers to automatically build, test, and deploy software changes, reducing the time and effort required to deliver software updates.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Infrastructure as Code: DevOps encourages the use of infrastructure as code (IaC) to automate the provisioning and management of infrastructure. IaC allows developers to define infrastructure using code, making it easier to manage and deploy infrastructure changes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Monitoring and Feedback: DevOps relies on monitoring and feedback to identify issues and improve software quality. By monitoring applications and infrastructure in real-time, DevOps teams can quickly identify and resolve issues, ensuring that software is always performing at its best.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;DevOps Practices&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hQJO_9kf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aotmha772a6q3dj971ih.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hQJO_9kf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aotmha772a6q3dj971ih.jpeg" alt="Image description" width="295" height="171"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;DevOps is built on a set of best practices that aim to streamline the software delivery process and improve the quality and reliability of software. Some of the key DevOps practices include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Agile Development: DevOps teams typically use agile development methodologies, such as Scrum or Kanban, to rapidly iterate on software development and deliver new features and updates more quickly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Continuous Integration and Continuous Deployment: As mentioned earlier, DevOps promotes the use of continuous integration and continuous deployment (CI/CD) practices to automate the software delivery process. CI/CD allows developers to quickly and efficiently build, test, and deploy software changes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Infrastructure as Code: DevOps teams use infrastructure as code (IaC) to automate the provisioning and management of infrastructure. IaC allows teams to define infrastructure using code, making it easier to manage and deploy infrastructure changes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Configuration Management: DevOps teams use configuration management tools, such as Puppet or Chef, to automate the configuration of servers and other infrastructure components. Configuration management helps to ensure that infrastructure is consistent and can be easily managed and updated.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Monitoring and Logging: DevOps teams rely on monitoring and logging tools, such as Nagios or ELK, to track the performance of applications and infrastructure in real-time. By monitoring applications and infrastructure, DevOps teams can quickly identify and resolve issues, ensuring that software is always performing at its best.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;DevOps Tools&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xsMVvwD1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/80t68ttng1d8arxnn4tb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xsMVvwD1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/80t68ttng1d8arxnn4tb.png" alt="Image description" width="259" height="194"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;DevOps is a set of practices that relies heavily on automation and collaboration between development and operations teams to improve the speed, quality, and reliability of software delivery. DevOps tools are used to automate various stages of the software delivery process, including code management, continuous integration and continuous deployment (CI/CD), infrastructure management, testing, and monitoring. In this article, we will provide an overview of some of the most commonly used DevOps tools.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Version Control Tools: Version control tools, such as Git or Subversion, are used to manage code changes and track the history of code changes over time. Version control tools allow multiple developers to work on the same codebase, managing code changes in a central repository. This makes it easier to collaborate on code, review changes, and track the evolution of the codebase over time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CI/CD Tools: CI/CD tools, such as Jenkins, Travis CI, or CircleCI, automate the software delivery process, allowing developers to quickly and efficiently build, test, and deploy software changes. CI/CD tools automate various stages of the software delivery pipeline, including code compilation, unit testing, integration testing, and deployment. This helps to reduce errors, speed up the delivery process, and improve software quality.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Configuration Management Tools: Configuration management tools, such as Puppet or Chef, are used to automate the configuration of servers and other infrastructure components. Configuration management tools help to ensure that infrastructure is consistent and can be easily managed and updated. These tools allow DevOps teams to define infrastructure as code, making it easier to manage and deploy infrastructure changes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Containerization Tools: Containerization tools, such as Docker or Kubernetes, are used to package applications and their dependencies into containers, which can be easily deployed and managed in various environments. Containerization helps to improve application portability, making it easier to deploy applications across different platforms and environments.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Monitoring and Logging Tools: Monitoring and logging tools, such as Nagios or ELK, are used to track the performance of applications and infrastructure in real-time. Monitoring and logging tools allow DevOps teams to quickly identify and resolve issues, ensuring that software is always performing at its best. These tools can be used to track various metrics, including application performance, server uptime, and resource usage.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In conclusion, DevOps is a methodology that combines development and operations practices to improve software delivery speed, quality, and reliability. DevOps tools play a critical role in automating various stages of the software delivery process, including code management, continuous integration and continuous deployment, infrastructure management, testing, and monitoring. By adopting DevOps practices and tools, organizations can achieve faster, more reliable software delivery, better collaboration between development and operations teams, and improved software quality. It's important to choose the right DevOps tools based on the specific needs and requirements of the organization and to continually evaluate and adjust the DevOps process to ensure ongoing success. Overall, DevOps is an essential approach for organizations that want to stay competitive in today's fast-paced software development landscape.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Introduction to Test-Driven Development (TDD)</title>
      <dc:creator>Lancelot03</dc:creator>
      <pubDate>Sun, 30 Apr 2023 18:23:13 +0000</pubDate>
      <link>https://dev.to/lancelot03/introduction-to-test-driven-development-tdd-1k2c</link>
      <guid>https://dev.to/lancelot03/introduction-to-test-driven-development-tdd-1k2c</guid>
      <description>&lt;p&gt;&lt;strong&gt;Test-Driven Development (TDD)&lt;/strong&gt; is a software development approach that emphasizes writing automated tests for code before actually writing the code itself. TDD involves writing a test case that specifies the behavior of the code to be developed, running the test, and then writing the minimum amount of code required to pass the test. The process is then repeated for each new feature or modification to the codebase.&lt;/p&gt;

&lt;p&gt;The TDD approach has several benefits. By writing tests before writing code, developers are forced to think carefully about the requirements and expected behavior of the code. This can help to catch potential bugs and edge cases early in the development process, reducing the cost of fixing them later on. TDD also helps to ensure that the code is modular, reusable, and maintainable, since each new feature is developed in isolation and must pass a set of tests before it can be integrated into the main codebase.&lt;/p&gt;

&lt;p&gt;The TDD approach consists of three stages:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DTZCa70B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5hk5qyt7cy5e31s9anj9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DTZCa70B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5hk5qyt7cy5e31s9anj9.png" alt="Image description" width="276" height="183"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;1. Write a test case:&lt;/em&gt;&lt;/strong&gt; The first step in TDD is to write a test case that specifies the behavior of the code to be developed. The test case should be written in a way that can be automated, and it should be clear and unambiguous.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;2. Run the test:&lt;/em&gt;&lt;/strong&gt; After writing the test case, the developer runs the test to ensure that it fails. This step is important because it ensures that the test is actually testing what it is supposed to test.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;3. Write the minimum amount of code required to pass the test:&lt;/em&gt;&lt;/strong&gt; The next step is to write the minimum amount of code required to pass the test. This code should be simple, clear, and focused on passing the test.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--igEVlUG7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qiqwwopzq83hls4fdhqg.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--igEVlUG7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qiqwwopzq83hls4fdhqg.jpeg" alt="Image description" width="189" height="267"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The process is then repeated for each new feature or modification to the codebase.&lt;/p&gt;

&lt;p&gt;The TDD approach is often used in combination with other software development practices, such as Agile development and Continuous Integration/Continuous Deployment (CI/CD). TDD helps to ensure that code is thoroughly tested and ready for integration into the main codebase, making it a valuable tool for any software development project.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>productivity</category>
      <category>devops</category>
      <category>learning</category>
    </item>
    <item>
      <title>Hacktoberfest 2022 🎉</title>
      <dc:creator>Lancelot03</dc:creator>
      <pubDate>Tue, 11 Oct 2022 16:09:14 +0000</pubDate>
      <link>https://dev.to/lancelot03/hacktoberfest-2022-1h69</link>
      <guid>https://dev.to/lancelot03/hacktoberfest-2022-1h69</guid>
      <description>&lt;p&gt;&lt;strong&gt;Hacktoberfest encourages participation in the open source community, which grows bigger every year. Complete the 2022 challenge and earn a limited edition T-shirt.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://hacktoberfest.com/"&gt;Register&lt;/a&gt; for Hacktoberfest and make four pull requests (PRs) between October 1st-31st to grab free T-shirt and more.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  You can easily contribute to my GitHub &lt;a href="https://github.com/Lancelot03/Hacktoberfest-2022"&gt;repository&lt;/a&gt;.
&lt;/h2&gt;

&lt;p&gt;You can upload your file of any programming language or if folder is not present then create folder. Some more repos for contribution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rules
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Don't use filthy words and be welcome for beginners and other people in this community.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;And enjoyed the open source participation.&lt;/em&gt;😄&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  GitHub Contribution Rules
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;This year, only the first 40,000 participants can earn a T-&lt;br&gt;
shirt. So, Hurry up&lt;/em&gt;😁&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;To get a shirt, you must make four approved pull requests (PRs) on opted-in projects between October 1-31 in any time zone.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Pull requests can be submitted to any opted-in repository on GitHub or GitLab.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;The pull request must contain commits you made yourself.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;If a maintainer reports your pull request as spam, it will not be counted toward your participation in Hacktoberfest.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;If a maintainer reports behavior that’s not in line with the project’s code of conduct, you will be ineligible to participate.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Getting Started 😁😎
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Fork this &lt;a href="https://github.com/Lancelot03/Code-The-Problem"&gt;repo&lt;/a&gt; (button on top)or Clone on your local machine.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh repo clone Lancelot03/Code-The-Problem
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Create a new Branch
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout -b my-new-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Add your contribution
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Commit your changes.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit -m "Relevant message"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Then push
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push origin my-new-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;And don't forget to create pull request from your forked repository &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;And if you are not comfortable using Git you can use directly the GitHub&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;&lt;em&gt;And please feel free to reach me if you face any issues.&lt;/em&gt;&lt;/u&gt;&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
      <category>contribute</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Angry Professor Problem</title>
      <dc:creator>Lancelot03</dc:creator>
      <pubDate>Mon, 22 Aug 2022 16:10:13 +0000</pubDate>
      <link>https://dev.to/lancelot03/angry-professor-problem-494k</link>
      <guid>https://dev.to/lancelot03/angry-professor-problem-494k</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import math
import os
import random
import re
import sys

def angryProfessor(k, a):
    return 'YES' if sum(map(lambda x: x &amp;lt;= 0, a)) &amp;lt; k else 'NO'

if __name__ == '__main__':
    fptr = open(os.environ['OUTPUT_PATH'], 'w')

    t = int(input().strip())

    for t_itr in range(t):
        first_multiple_input = input().rstrip().split()

        n = int(first_multiple_input[0])

        k = int(first_multiple_input[1])

        a = list(map(int, input().rstrip().split()))

        result = angryProfessor(k, a)

        fptr.write(result + '\n')

    fptr.close()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>beginners</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>python</category>
    </item>
    <item>
      <title>Linked List Part-3</title>
      <dc:creator>Lancelot03</dc:creator>
      <pubDate>Wed, 10 Aug 2022 18:09:42 +0000</pubDate>
      <link>https://dev.to/lancelot03/linked-list-part-3-4ni3</link>
      <guid>https://dev.to/lancelot03/linked-list-part-3-4ni3</guid>
      <description>&lt;p&gt;find the middle element of a singly linked list without iterating the list more than once?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution- ### Python&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Node* getMiddle(Node *head)
{
     struct Node *slow = head;
     struct Node *fast = head;

     if (head)
     {
         while (fast != NULL &amp;amp;&amp;amp; fast-&amp;gt;next != NULL)
         {
             fast = fast-&amp;gt;next-&amp;gt;next;
             slow = slow-&amp;gt;next;
         }
     }
     return slow;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>beginners</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>python</category>
    </item>
    <item>
      <title>Lisa's Workbook</title>
      <dc:creator>Lancelot03</dc:creator>
      <pubDate>Fri, 05 Aug 2022 19:17:28 +0000</pubDate>
      <link>https://dev.to/lancelot03/lisas-workbook-20bm</link>
      <guid>https://dev.to/lancelot03/lisas-workbook-20bm</guid>
      <description>&lt;p&gt;Lisa just got a new math workbook. A workbook contains exercise problems, grouped into chapters. Lisa believes a problem to be special if its index (within a chapter) is the same as the page number where it's located. The format of Lisa's book is as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;There are &lt;em&gt;n&lt;/em&gt; chapters in Lisa's workbook, numbered from &lt;em&gt;1&lt;/em&gt; to &lt;em&gt;n&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;em&gt;ith&lt;/em&gt; chapter has &lt;em&gt;arr[i]&lt;/em&gt; problems, numbered from &lt;em&gt;1&lt;/em&gt; to &lt;em&gt;n&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Each page can hold up to &lt;em&gt;k&lt;/em&gt; problems. Only a chapter's last page of exercises may contain fewer than &lt;em&gt;k&lt;/em&gt; problems.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Each new chapter starts on a new page, so a page will never contain problems from more than one chapter.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The page number indexing starts at 1.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Given the details for Lisa's workbook, can you count its number of &lt;em&gt;special problems&lt;/em&gt;?&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;arr = [4,2]
k=3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example, Lisa’s workbook contains &lt;code&gt;arr[1]=4&lt;/code&gt; problems for chapter &lt;code&gt;1&lt;/code&gt;, and &lt;code&gt;arr[2]=2&lt;/code&gt; problems for chapter &lt;code&gt;2&lt;/code&gt;. Each page can hold &lt;code&gt;k=3&lt;/code&gt; problems. The first page will hold &lt;code&gt;3&lt;/code&gt; problems for chapter &lt;code&gt;1&lt;/code&gt;. Problem &lt;code&gt;1&lt;/code&gt; is on page &lt;code&gt;1&lt;/code&gt;, so it is &lt;em&gt;special&lt;/em&gt;. Page &lt;code&gt;2&lt;/code&gt; contains only Chapter &lt;code&gt;1&lt;/code&gt;, Problem &lt;code&gt;4&lt;/code&gt;, so no special problem is on page &lt;code&gt;2&lt;/code&gt;. Chapter &lt;code&gt;2&lt;/code&gt; problems start on page &lt;code&gt;3&lt;/code&gt; and there are &lt;code&gt;2&lt;/code&gt; problems. Since there is no problem &lt;code&gt;3&lt;/code&gt; on page &lt;code&gt;3&lt;/code&gt;, there is no &lt;em&gt;special problem&lt;/em&gt; on that page either. There is special problem in her workbook.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Function Description&lt;/strong&gt;&lt;br&gt;
Complete the workbook function in the editor below. It should return an integer that represents the number of special problems in the workbook.&lt;/p&gt;

&lt;p&gt;workbook has the following parameter(s):&lt;/p&gt;

&lt;p&gt;&lt;code&gt;n&lt;/code&gt;: an integer that denotes the number of chapters&lt;br&gt;
&lt;code&gt;k&lt;/code&gt;: an integer that denotes the maximum number of problems per page&lt;br&gt;
&lt;code&gt;arr&lt;/code&gt;: an array of integers that denote the number of problems in each chapter&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Input Format&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first line contains two integers &lt;code&gt;n&lt;/code&gt; and &lt;code&gt;k&lt;/code&gt;, the number of chapters and the maximum number of problems per page.&lt;br&gt;
The second line contains &lt;code&gt;n&lt;/code&gt; space-separated integers &lt;code&gt;arr[i]&lt;/code&gt; where &lt;code&gt;arr[i]&lt;/code&gt; denotes the number of problems in the &lt;code&gt;ith&lt;/code&gt; chapter.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output Format&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Print the number of &lt;em&gt;special problems&lt;/em&gt; in Lisa’s workbook.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample Input&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;5 3 
4 2 6 1 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Sample Output&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Solution- ### Python&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def readInts():
    return map(int, raw_input().strip().split(' '))

n, k = readInts()
ts = readInts()

# n = 5
# k = 3
# ts = [4, 2, 6, 1, 10]

ans = 0
pageNum = 1
for chapter, problems in enumerate(ts):
    pageLeft = k
    for problemId in xrange(1, problems+1):
        if pageNum == problemId:
            ans += 1
        pageLeft -= 1
        if pageLeft == 0:
            pageLeft = k
            pageNum += 1
    if pageLeft &amp;lt; k:
        pageNum += 1

print ans
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>programming</category>
      <category>python</category>
      <category>discuss</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Linked List Part-2</title>
      <dc:creator>Lancelot03</dc:creator>
      <pubDate>Thu, 28 Jul 2022 18:07:28 +0000</pubDate>
      <link>https://dev.to/lancelot03/linked-list-part-2-329k</link>
      <guid>https://dev.to/lancelot03/linked-list-part-2-329k</guid>
      <description>&lt;p&gt;Linked List Insertion at the front--&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DFdbbpU7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sa7hkyqojzmy3eq2gbgl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DFdbbpU7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sa7hkyqojzmy3eq2gbgl.png" alt="Insertion at the front" width="276" height="183"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Node:
    def __init__(self, data):
        self.data=data
        self.ref=None 
class LinkedList:
    def __int__(self):
        self.head=None

    def begin(self,new_data):    
        q1=Node(new_data)
        q1.ref=self.head
        self.head=q1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Insertion at the Middle--&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--evqxPfKB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uvwps4o1og24za0zqpkm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--evqxPfKB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uvwps4o1og24za0zqpkm.png" alt="Insertion at the Middle" width="251" height="200"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def inbet(self,prev,new_data):
        if prev.ref is None:
            print('LL is empty')
            return
        q4 = Node(new_data)
        q4.ref=prev.ref
        prev.ref=q4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Insertion at the End--&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--e8aN5rsQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bodb63481sz0cv7zggs5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--e8aN5rsQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bodb63481sz0cv7zggs5.png" alt="Insertion at the End" width="309" height="163"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def last(self,new_data):
        q2=Node(new_data)
        if self.head==None:
            self.head=q2
            return
        temp=self.head
        while(temp.ref):
            temp=temp.ref

        temp.ref=q2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Printing Of Linked List--&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def print_ll(self):
        if self.head is None:
            print("Linked list is empty")
            return
        n=self.head
        while n:
            print(n.data)
            n=n.ref
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Function Calling--&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;h1=Node(2)
h2=Node(3)

k1=LinkedList()
k1.head=h1
h1.ref=h2

k1.begin(1)
k1.inbet(k1.head.ref,5)
k1.last(8)

k1.print_ll()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>beginners</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>python</category>
    </item>
    <item>
      <title>Linked List</title>
      <dc:creator>Lancelot03</dc:creator>
      <pubDate>Sun, 24 Jul 2022 17:18:00 +0000</pubDate>
      <link>https://dev.to/lancelot03/linked-list-3h0h</link>
      <guid>https://dev.to/lancelot03/linked-list-3h0h</guid>
      <description>&lt;p&gt;Linked List Creation--&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Node:   # Node Creation
    def __init__(self, data):
        self.data=data
        self.ref=None 
class LinkedList:   # Connecting the nodes
    def __int__(self):
        self.head=None
    def print_ll(self):  # Printing of the created linhed list
        if self.head is None:
            print("Linked list is empty")
            return
        n=self.head
        while n:
            print(n.data)
            n=n.ref

node1 =Node(10)   # Given the vazlue in the 1st node
node2=Node(2)   # Giving the value in the second node
q1=LinkedList()  # Calling the Linkeglist function
q1.head=node1  # pointing of q1 as a head node
node1.ref=node2   # storing the addresss of the 2nd node into 
                    first node
q1.print_ll()  # printing of q1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>beginners</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>python</category>
    </item>
    <item>
      <title>Square(n) Sum</title>
      <dc:creator>Lancelot03</dc:creator>
      <pubDate>Tue, 19 Jul 2022 17:51:35 +0000</pubDate>
      <link>https://dev.to/lancelot03/squaren-sum-5h6k</link>
      <guid>https://dev.to/lancelot03/squaren-sum-5h6k</guid>
      <description>&lt;p&gt;DESCRIPTION:&lt;br&gt;
Complete the square sum function so that it squares each number passed into it and then sums the results together.&lt;/p&gt;

&lt;p&gt;For example, for [1, 2, 2] it should return 9 because 1^2 + 2^2 + 2^2 = 9.&lt;/p&gt;

&lt;p&gt;Sample Tests-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import codewars_test as test
from solution import square_sum

@test.describe("Fixed Tests")
def basic_tests():
    @test.it('Basic Test Cases')
    def basic_test_cases():
        test.assert_equals(square_sum([1,2]), 5)
        test.assert_equals(square_sum([0, 3, 4, 5]), 50)
        test.assert_equals(square_sum([]), 0)
        test.assert_equals(square_sum([-1,-2]), 5)
        test.assert_equals(square_sum([-1,0,1]), 2)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Solution- ###Python&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def square_sum(numbers):
    a=[]
    for i in range(len(numbers)):
        a.append(numbers[i]**2)
    return sum(a)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>beginners</category>
      <category>programming</category>
      <category>python</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Regex validate PIN code</title>
      <dc:creator>Lancelot03</dc:creator>
      <pubDate>Wed, 13 Jul 2022 18:36:50 +0000</pubDate>
      <link>https://dev.to/lancelot03/regex-validate-pin-code-5973</link>
      <guid>https://dev.to/lancelot03/regex-validate-pin-code-5973</guid>
      <description>&lt;p&gt;ATM machines allow 4 or 6 digit PIN codes and PIN codes cannot contain anything but exactly 4 digits or exactly 6 digits.&lt;/p&gt;

&lt;p&gt;If the function is passed a valid PIN string, return &lt;code&gt;true&lt;/code&gt;, else return &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Examples (Input --&amp;gt; Output)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"1234"   --&amp;gt;  true
"12345"  --&amp;gt;  false
"a234"   --&amp;gt;  false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sample Tests&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import codewars_test as test
from solution import validate_pin

@test.describe("Fixed Tests")
def fixed_tests():
    @test.it("should return False for pins with length other than 4 or 6")
    def basic_test_cases():    
        test.assert_equals(validate_pin("1"),False, "Wrong output for '1'")
        test.assert_equals(validate_pin("12"),False, "Wrong output for '12'")
        test.assert_equals(validate_pin("123"),False, "Wrong output for '123'")
        test.assert_equals(validate_pin("12345"),False, "Wrong output for '12345'")
        test.assert_equals(validate_pin("1234567"),False, "Wrong output for '1234567'")
        test.assert_equals(validate_pin("-1234"),False, "Wrong output for '-1234'")
        test.assert_equals(validate_pin("-12345"),False, "Wrong output for '-12345'")
        test.assert_equals(validate_pin("1.234"),False, "Wrong output for '1.234'")
        test.assert_equals(validate_pin("00000000"),False, "Wrong output for '00000000'")

    @test.it("should return False for pins which contain characters other than digits")
    def _():
        test.assert_equals(validate_pin("a234"),False, "Wrong output for 'a234'")
        test.assert_equals(validate_pin(".234"),False, "Wrong output for '.234'")

    @test.it("should return True for valid pins")
    def _():
        test.assert_equals(validate_pin("1234"),True, "Wrong output for '1234'")
        test.assert_equals(validate_pin("0000"),True, "Wrong output for '0000'")
        test.assert_equals(validate_pin("1111"),True, "Wrong output for '1111'")
        test.assert_equals(validate_pin("123456"),True, "Wrong output for '123456'")
        test.assert_equals(validate_pin("098765"),True, "Wrong output for '098765'")
        test.assert_equals(validate_pin("000000"),True, "Wrong output for '000000'")
        test.assert_equals(validate_pin("123456"),True, "Wrong output for '123456'")
        test.assert_equals(validate_pin("090909"),True, "Wrong output for '090909'")

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

&lt;/div&gt;



&lt;p&gt;Solution- ###Python&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def validate_pin(pin):
    if(type(pin) != str or len(pin) not in [4, 6]):
        return(False)
    for c in pin:
        if c not in "0123456789":
            return(False)
    return(True)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>programming</category>
      <category>beginners</category>
      <category>python</category>
      <category>discuss</category>
    </item>
    <item>
      <title>A Chain adding function</title>
      <dc:creator>Lancelot03</dc:creator>
      <pubDate>Mon, 11 Jul 2022 18:19:24 +0000</pubDate>
      <link>https://dev.to/lancelot03/a-chain-adding-function-4h11</link>
      <guid>https://dev.to/lancelot03/a-chain-adding-function-4h11</guid>
      <description>&lt;p&gt;We want to create a function that will add numbers together when called in succession.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;add(1)(2) # equals 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We also want to be able to continue to add numbers to our chain.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;add(1)(2)(3) # 6
add(1)(2)(3)(4); # 10
add(1)(2)(3)(4)(5) # 15
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and so on.&lt;/p&gt;

&lt;p&gt;A single call should be equal to the number passed in.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;add(1) # 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We should be able to store the returned values and reuse them.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;addTwo = add(2)
addTwo # 2
addTwo + 5 # 7
addTwo(3) # 5
addTwo(3)(5) # 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can assume any number being passed in will be valid whole number.&lt;/p&gt;

&lt;p&gt;Sample Tests-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import codewars_test as test
from solution import add


@test.it("Basic tests")
def _():
    test.assert_equals(add(1), 1)
    test.assert_equals(add(1)(2), 3)
    test.assert_equals(add(1)(2)(3), 6)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Solution- ###Python&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class add(int):
    def __call__(self, n):
        return add(self + n)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>programming</category>
      <category>python</category>
      <category>oops</category>
      <category>mathematic</category>
    </item>
  </channel>
</rss>
