<?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: MMK2020</title>
    <description>The latest articles on DEV Community by MMK2020 (@mmk2020).</description>
    <link>https://dev.to/mmk2020</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%2F810513%2F0dc8ec68-7e2e-422e-bd95-664c48e469f9.png</url>
      <title>DEV Community: MMK2020</title>
      <link>https://dev.to/mmk2020</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mmk2020"/>
    <language>en</language>
    <item>
      <title>The Ultimate Guide to Getting Started in Data Science</title>
      <dc:creator>MMK2020</dc:creator>
      <pubDate>Sun, 03 Apr 2022 19:41:52 +0000</pubDate>
      <link>https://dev.to/mmk2020/the-ultimate-guide-to-getting-started-in-data-science-4jeb</link>
      <guid>https://dev.to/mmk2020/the-ultimate-guide-to-getting-started-in-data-science-4jeb</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is Data Science?&lt;/strong&gt;&lt;br&gt;
According to &lt;strong&gt;Wikipedia&lt;/strong&gt; “Data science is an interdisciplinary field that uses scientific methods, processes, algorithms and systems to extract knowledge and insights from noisy, structured and unstructured data,and apply knowledge and actionable insights from data across a broad range of application domains.”&lt;/p&gt;

&lt;p&gt;It further add adds “Data science is a "concept to unify statistics, data analysis, informatics, and their related methods" in order to "understand and analyse actual phenomena" with data.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Who is a data scientist?&lt;/strong&gt;&lt;br&gt;
“A &lt;strong&gt;data scientist&lt;/strong&gt; is someone who is able to lead a team of data analysts or data engineers to work towards solving a business problem, by collecting data and come out with relevant findings which can potentially help the company’s growth.” - &lt;a href="https://thelead.io/ultimate-guide-data-science"&gt;https://thelead.io/ultimate-guide-data-science&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Data Engineers focus on making the data available and accessible to data scientists integrating various data sources and optimizing access to data while the data analysts are responsible for extracting insight from the data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lifecycle of Data Science&lt;/strong&gt;&lt;br&gt;
The core job of Data Scientists is to address problems and construct Models to make better decisions for multifaceted business challenges. Data Science processes involve the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Defining Business Problem – This will be the main objective of the entire process so as to satisfy external stakeholders&lt;/li&gt;
&lt;li&gt;Data Collection and Preparation &lt;/li&gt;
&lt;li&gt;Exploratory Data Analysis&lt;/li&gt;
&lt;li&gt;Model Building&lt;/li&gt;
&lt;li&gt;Model Optimization&lt;/li&gt;
&lt;li&gt;Model Deployment and Evaluation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Tools used in Data Science&lt;/strong&gt;&lt;br&gt;
Statistics and Probability – Basic to advance knowledge of statistics and probability is required. From the simple measure of central tendencies (mean, mode and median) to complex multivariate probability distributions.&lt;/p&gt;

&lt;p&gt;Data Mining &amp;amp; Cleaning - How to collect, extract, query, clean, and aggregate data for analysis.&lt;/p&gt;

&lt;p&gt;Exploratory Data Analysis - How to explore datasets using visual analytics and statistical analysis.&lt;/p&gt;

&lt;p&gt;Data Visualization and Storytelling Skills - Data storytelling combines data with human communication to craft an engaging narrative that’s anchored by facts. It uses data visualization techniques (e.g., charts and images) to convey the meaning of the data in a way that’s compelling and relevant to the audience.&lt;/p&gt;

&lt;p&gt;Modelling, Validation &amp;amp; Problem Solving - A model is a mathematical representation of the real world and is used in formulating hypotheses and trying to solve business problems. All models must be validated using test data in order to provide insight into real-world problems and solutions.&lt;/p&gt;

&lt;p&gt;Programming Language – Learn to program in computer programming languages that are commonly used in data science like R and &lt;strong&gt;Python&lt;/strong&gt;. Other programming languages can be used, but when it comes to data science these two are the most popular. In addition Python and R are supported by libraries and packages that are meant for data science. &lt;/p&gt;

&lt;p&gt;Communication - Communicate key findings and results by creating an effective presentation.&lt;/p&gt;

&lt;p&gt;A.I. &amp;amp; Machine Learning - Artificial Intelligence is broad field with many subfields with of which one of them is machine learning. &lt;/p&gt;

&lt;p&gt;Big Data Analysis - Big data is information that has one or all of the following; volume, velocity, variety and veracity.&lt;/p&gt;

&lt;p&gt;References&lt;br&gt;
&lt;a href="https://en.wikipedia.org/wiki/Data_science"&gt;https://en.wikipedia.org/wiki/Data_science&lt;/a&gt;&lt;br&gt;
&lt;a href="https://hevodata.com/learn/data-science-simplified/"&gt;https://hevodata.com/learn/data-science-simplified/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://thelead.io/ultimate-guide-data-science"&gt;https://thelead.io/ultimate-guide-data-science&lt;/a&gt;&lt;/p&gt;

</description>
      <category>datascience</category>
      <category>beginners</category>
      <category>python</category>
    </item>
    <item>
      <title>Something short about MongoDB</title>
      <dc:creator>MMK2020</dc:creator>
      <pubDate>Tue, 29 Mar 2022 19:45:36 +0000</pubDate>
      <link>https://dev.to/mmk2020/something-short-about-mongodb-3eap</link>
      <guid>https://dev.to/mmk2020/something-short-about-mongodb-3eap</guid>
      <description>&lt;p&gt;I have worked with relational databases particularly MySQL and later on MariaDB.&lt;/p&gt;

&lt;p&gt;So recently I decided to check out MongoDB and test the NoSQL world for a bit. Still there is much for me to learn.&lt;/p&gt;

&lt;p&gt;MongoDB is a NoSQL, document oriented, cross platform database program. MongoDB uses  JSON-like (Binary JSON - BSON)  documents with optional schemas. Apparently the word MongoDB is derived from two words Humongous Database &lt;/p&gt;

&lt;p&gt;NoSQL databases store data differently than relational tables, specifically they don’t have tables.&lt;/p&gt;

&lt;p&gt;MongoDB stores data records as documents (specifically BSON documents) which are gathered together in collections. A database stores one or more collections of documents. Collections are analogous to tables in relational databases.&lt;/p&gt;

&lt;p&gt;According to Wikipedia MongoDB comes in three editions MongoDB Community Server, MongoDB Enterprise Server and MongoDB Atlas&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MongoDB Community Server&lt;/strong&gt;&lt;br&gt;
The MongoDB Community Edition is free and available for Windows, Linux, and macOS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MongoDB Enterprise Server&lt;/strong&gt;&lt;br&gt;
MongoDB Enterprise Server is the commercial edition of MongoDB, available as part of the MongoDB Enterprise Advanced subscription.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;MongoDB Atlas&lt;/strong&gt;&lt;br&gt;
MongoDB is also available as an on-demand fully managed service. MongoDB Atlas runs on AWS, Microsoft Azure, and Google Cloud Platform.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Restrictions on Database names&lt;/strong&gt;&lt;br&gt;
Database names are case-sensitive in MongoDB but they must also differ on more than just case otherwise you will get an error.&lt;br&gt;
Database names for deployments running on Windows systems cannot contain any of the following characters: &lt;strong&gt;/. "$*&amp;lt;&amp;gt;:|?&lt;/strong&gt; While those deployed on Linux/Unix systems cannot contain any of the following characters: &lt;strong&gt;/. "$&lt;/strong&gt;&lt;br&gt;
Database names cannot be empty and must have fewer than 64 characters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Restriction on Collection Names&lt;/strong&gt;&lt;br&gt;
Collection names should begin with an underscore or a letter character, and cannot: contain the &lt;strong&gt;$&lt;/strong&gt;, be an empty string, contain the null character, and begin with the system prefix.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Restrictions on Field Names&lt;/strong&gt;&lt;br&gt;
Field names cannot contain the null character.&lt;br&gt;
The field name &lt;strong&gt;_id&lt;/strong&gt; is reserved for use as a primary key; its value must be unique in the collection, is immutable, and may be of any type other than an array. If the &lt;strong&gt;_id&lt;/strong&gt; contains subfields, the subfield names cannot begin with a ($) symbol.&lt;/p&gt;

&lt;p&gt;The MongoDB Shell a.k.a &lt;strong&gt;mongosh&lt;/strong&gt; is an interactive environment for interacting with MongoDB deployments, from here you can issue commands to query and interact with your database.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://www.mongodb.com/docs"&gt;https://www.mongodb.com/docs&lt;/a&gt;&lt;br&gt;
&lt;a href="https://en.wikipedia.org/wiki/MongoDB"&gt;https://en.wikipedia.org/wiki/MongoDB&lt;/a&gt;&lt;/p&gt;

</description>
      <category>mongodb</category>
      <category>nosql</category>
      <category>database</category>
      <category>rdbms</category>
    </item>
    <item>
      <title>Modern Python for everyone: Mastering Modern Python the Right Way</title>
      <dc:creator>MMK2020</dc:creator>
      <pubDate>Thu, 03 Mar 2022 07:59:55 +0000</pubDate>
      <link>https://dev.to/mmk2020/modern-python-for-everyone-mastering-modern-python-the-right-way-23mo</link>
      <guid>https://dev.to/mmk2020/modern-python-for-everyone-mastering-modern-python-the-right-way-23mo</guid>
      <description>&lt;p&gt;&lt;em&gt;&amp;gt; "To become really good at anything, you have to practice and repeat, practice and repeat, until the technique becomes intuitive." - Paulo Coelho&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&amp;gt; “You become a master in what you repeatedly do in consistency. Mastery is not born; it is acquired. It is not blood-linked; it is skill-learnt! “- Israelmore Ayivor&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&amp;gt; “I fear not the man who has practiced 10,000 kicks once, but I fear the man who has practiced one kick 10,000 times." - Bruce Lee&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This article is about mastering the Python programming language in most effective and efficient way. The steps shown here are very similar to the previous article I wrote about mastering JavaScript. You can find the previous article about JavaScript &lt;a href="https://dev.to/mmk2020/modern-javascript-for-everyone-mastering-modern-javascript-the-right-way-62e"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Python is a language has syntax that is easy to understand. However mastering the language is another thing. The best and recommended way to master Python is through consistent practice and more practice until it becomes second nature.&lt;/p&gt;

&lt;p&gt;However for you to practice Python in a manner that will lead to mastery, you have to fulfil some requirements as described below.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1.&lt;/strong&gt; Have you why for learning Python, it is easier to learn and understand something that you have passion about.  Check out the documentation and code examples to get a feel for what is up ahead. Try some online tutorials or books. You can also use freely available eBooks on the internet&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2.&lt;/strong&gt; Create time for study and time for practice. If you can’t allocate ample time for study, it will be very hard to move along.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3.&lt;/strong&gt; Learn the history of the language, why it was created, when it was created? , for whom and by whom was it created? Also learn its syntax, use cases and real life examples where Python is in use. Answering these questions will help you to know the strengths, weaknesses and peculiarity of Python. You should know that there is no perfect programming language.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4.&lt;/strong&gt; Learn the following concepts: For introduction understand how python works, environment and tools, and its comparison with other programming language. Write a hello world program. Learn input/output functions in Python, data types and variable declarations, python statements, operators (arithmetic, logical and comparison operators). Python conditionals (&lt;code&gt;if&lt;/code&gt; statement, &lt;code&gt;if&lt;/code&gt;&lt;code&gt;else&lt;/code&gt;, &lt;code&gt;if&lt;/code&gt; &lt;code&gt;elif&lt;/code&gt; &lt;code&gt;else&lt;/code&gt; and nesting of conditionals). Looping with &lt;code&gt;for&lt;/code&gt; and &lt;code&gt;while&lt;/code&gt; statement.  Python collections namely; lists, tuples, sets and dictionaries.  Python functions, classes and modules.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5.&lt;/strong&gt; Read Python documentation, blogs, watch online tutorial videos, read eBooks. The aim is to expose you to many scenarios where other people might be able to explain some concepts which you can’t grasp on your own. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6.&lt;/strong&gt; Participate actively in online Python forums, hackathons and other online activities. You can also form your own physical or virtual groups. Participate in open source projects and collaborate as much as possible. You can also participate in projects individually or as a group.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 7.&lt;/strong&gt; Keep up with Python Enhancement Proposals (PEP). PEPs are documents that describe new proposals of the Python language. PEP8 for example provides guidelines and best practices for writing readable code. &lt;/p&gt;

&lt;p&gt;This means new features are being added to the language to make it better and add more functionality. In that regard you have to keep abreast of any changes.&lt;/p&gt;

&lt;p&gt;If you are psyched to get started with Python, visit my article &lt;a href="https://dev.to/mmk2020/introduction-to-modern-python-114d"&gt;Introduction to Modern Python&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Modern JavaScript for everyone: Mastering Modern JavaScript the Right Way</title>
      <dc:creator>MMK2020</dc:creator>
      <pubDate>Wed, 02 Mar 2022 16:06:50 +0000</pubDate>
      <link>https://dev.to/mmk2020/modern-javascript-for-everyone-mastering-modern-javascript-the-right-way-62e</link>
      <guid>https://dev.to/mmk2020/modern-javascript-for-everyone-mastering-modern-javascript-the-right-way-62e</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"To become really good at anything, you have to practice and repeat, practice and repeat, until the technique becomes intuitive." - Paulo Coelho&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;“You become a master in what you repeatedly do in consistency. Mastery is not born; it is acquired. It is not blood-linked; it is skill-learnt! “- Israelmore Ayivor&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;“I fear not the man who has practiced 10,000 kicks once, but I fear the man who has practiced one kick 10,000 times." - Bruce Lee&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;JavaScript as a language has syntax that is easy to understand. However mastering the language is another thing. The best and recommended way to master JavaScript is through consistent practice and more practice until it becomes second nature. &lt;/p&gt;

&lt;p&gt;However for you to practice JavaScript in a manner that will lead to mastery, you have to fulfil some requirements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1.&lt;/strong&gt; Have your why for learning JavaScript, it is easier to learn and understand something that you have passion about. Why are you learning JavaScript of all the available programming languages out there? Is it because it is most widely used for frontend and can be used for backend as well? Is it because it is open source?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2.&lt;/strong&gt; Create time for study and time for practice. If you can’t allocate ample time for study, it will be very hard to move along.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3.&lt;/strong&gt; Learn the history of the language, why it was created, when it was created? , for whom and by whom was it created? Also learn its syntax, use cases and real life examples where JavaScript is in use. Answering these questions will help you to know the strengths, weaknesses and peculiarity of JavaScript. You should know that there is no perfect programming language.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4.&lt;/strong&gt; Learn the following concepts: JavaScript environment and runtime engines, interaction with the user i.e. the input/output via HTML elements or browser console, JavaScript datatypes (numbers, strings, boolean …), comments, variable declarations (&lt;code&gt;var&lt;/code&gt;, &lt;code&gt;let&lt;/code&gt; and &lt;code&gt;const&lt;/code&gt;) , operators (arithmetic, logical and comparison), conditional statements (if , if else, if else if and switch), looping/iteration (&lt;code&gt;for&lt;/code&gt; , &lt;code&gt;while&lt;/code&gt; and &lt;code&gt;do while&lt;/code&gt;) , JavaScript functions, array, objects , classes ,JSON and modules. Another important concept is the JavaScript event loop, since JavaScript is single threaded you need to learn about asynchronous functions, &lt;code&gt;setTimeOut&lt;/code&gt; function, promises etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5:&lt;/strong&gt; Read JavaScript documentation, blogs, watch online tutorial videos, read eBooks. The aim is to expose you to many scenarios where other people might be able to explain some concepts which you can’t grasp on your own. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6:&lt;/strong&gt; Participate actively in online JavaScript forums, hackathons and other online activities. You can also form your own physical or virtual groups. Participate in open source projects and collaborate as much as possible. You can also participate in projects individually or as a group.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 7:&lt;/strong&gt; The JavaScript language specification known as ES is always being updated. This means new features are being added to the language to make it better and add more functionality. In that regard you have to keep abreast of any changes.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>mastery</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Introduction to Data Structures and Algorithms With Modern JavaScript.</title>
      <dc:creator>MMK2020</dc:creator>
      <pubDate>Sun, 20 Feb 2022 17:40:33 +0000</pubDate>
      <link>https://dev.to/mmk2020/introduction-to-data-structures-and-algorithms-with-modern-javascript-fe8</link>
      <guid>https://dev.to/mmk2020/introduction-to-data-structures-and-algorithms-with-modern-javascript-fe8</guid>
      <description>&lt;h2&gt;
  
  
  What are data structures?
&lt;/h2&gt;

&lt;p&gt;A data structure is a method for storing and organizing data in a virtual system. It is used to denote a particular way of organizing data for particular types of operation such as modification, navigation, and access of information.  &lt;/p&gt;

&lt;p&gt;There are numerous data structures ranging from arrays and lists to more complex structures such as trees, heaps and graphs. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data structures help to:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Manage and utilize large datasets&lt;/li&gt;
&lt;li&gt;Quickly search for particular data from a database&lt;/li&gt;
&lt;li&gt;Build clear hierarchical or relational connections between data points&lt;/li&gt;
&lt;li&gt;Simplify and speed up data processing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each data structure has a task or situation it is most suited to solve. &lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Widely used basic data structures: *&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Arrays&lt;/li&gt;
&lt;li&gt;Linked lists&lt;/li&gt;
&lt;li&gt;Stacks &lt;/li&gt;
&lt;li&gt;Queues&lt;/li&gt;
&lt;li&gt;Hash tables&lt;/li&gt;
&lt;li&gt;Trees &lt;/li&gt;
&lt;li&gt;Graphs &lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What is an algorithm?
&lt;/h2&gt;

&lt;p&gt;An algorithm for a particular task is a finite sequence of instructions, each of which has a clear meaning and can be performed with a finite amount of effort in a finite length of time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Some common categories of algorithms are:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Searching &lt;/li&gt;
&lt;li&gt;Sorting&lt;/li&gt;
&lt;li&gt;Graph/tree traversing&lt;/li&gt;
&lt;li&gt;Dynamic programming&lt;/li&gt;
&lt;li&gt;Hashing and regex (string pattern matching)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Why data structures and algorithms
&lt;/h2&gt;

&lt;p&gt;When solving real-world coding problems, it is required that runtime and resource efficiency are achieved. Knowing the data structure and algorithm which best fits the current solution will increase program performance and reduce time required to make it. &lt;br&gt;
Proper understanding of data structures and algorithms ensures well-optimized and efficient code. &lt;/p&gt;

&lt;p&gt;The efficiency or performance (complexity) of an algorithm relates to the resources required by it, such as how quickly it will run (time complexity), or how much computer memory (space complexity) it will use.&lt;/p&gt;

&lt;p&gt;The ability to formulate an efficient algorithm depends on being able to organize the data in an appropriate manner. It is for this reason coding some coding interviews ask for demonstration of comprehension of data structures and algorithms.&lt;/p&gt;

&lt;h2&gt;
  
  
  JavaScript data structures
&lt;/h2&gt;

&lt;p&gt;JavaScript has primitive and non-primitive data structures.&lt;br&gt;
&lt;strong&gt;Primitive data structures&lt;/strong&gt; and data types are native to the programming language. These include boolean, null, number, string, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Non-primitive data structures&lt;/strong&gt; are not defined by the programming language but rather by the programmer. These include linear data structures, static data structures, and dynamic data structures, like queue and linked lists.&lt;/p&gt;

&lt;p&gt;Data structures to consider in JavaScript;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Arrays&lt;/li&gt;
&lt;li&gt;Queues &amp;amp; Stacks&lt;/li&gt;
&lt;li&gt;Linked List&lt;/li&gt;
&lt;li&gt;Trees&lt;/li&gt;
&lt;li&gt;Graphs&lt;/li&gt;
&lt;li&gt;Hashtables / maps&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Arrays
&lt;/h2&gt;

&lt;p&gt;Arrays are sequences of primitive data types, similar to a list. Each array has a fixed number of cells decided on its creation, and each cell has a corresponding numeric index used to select its data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Queues &amp;amp; Stacks
&lt;/h2&gt;

&lt;p&gt;Stacks and queues differ from the exact definition of arrays in other programming languages by how objects are added or removed.&lt;/p&gt;

&lt;p&gt;Both queues and stacks offer the opportunity to display every datatype stored within the array and to slice and “peek” at particular elements. This is also true of the JavaScript array type, which is a specially defined object in JavaScript.&lt;/p&gt;

&lt;p&gt;Queues are conceptually similar to stacks; both are sequential structures, but queues process elements in the order they were entered rather than the most recent element.&lt;/p&gt;

&lt;p&gt;Queues are FIFO (first in, first out) while stacks are LIFO (last in, first out).  As a result, queues can be thought of as a FIFO (First In, First Out) version of stacks. These are helpful as a buffer for requests, storing each request in the order it was received until it can be processed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Linked Lists
&lt;/h2&gt;

&lt;p&gt;Linked lists are a data structure which, does not use physical placement of data in memory. This means that, rather than indexes or positions, linked lists use a referencing system: elements are stored in nodes that contain a pointer to the next node, repeating until all nodes are linked.&lt;/p&gt;

&lt;p&gt;This system allows efficient insertion and removal of items without the need for reorganization.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trees
&lt;/h2&gt;

&lt;p&gt;Trees are another relation-based data structure, which specialize in representing hierarchical structures. Like a linked list, nodes contain both elements of data and pointers marking its relation to immediate nodes.&lt;/p&gt;

&lt;p&gt;Each tree has a “root” node, off of which all other nodes branch. The root contains references to all elements directly below it, which are known as its “child nodes”. This continues, with each child node, branching off into more child nodes.&lt;/p&gt;

&lt;p&gt;Nodes with linked child nodes are called internal nodes while those without child nodes are external nodes. A common type of tree is the “binary search tree” which is used to easily search stored data.&lt;/p&gt;

&lt;p&gt;These search operations are highly efficient, as its search duration is dependent not on the number of nodes but on the number of levels down the tree.&lt;/p&gt;

&lt;h2&gt;
  
  
  Graphs
&lt;/h2&gt;

&lt;p&gt;Graphs are a relation-based data structure helpful for storing web-like relationships. Each node, or vertex, as they’re called in graphs, has a title (A, B, C, etc.), a value contained within, and a list of links (called edges) it has with other vertices.&lt;/p&gt;

&lt;p&gt;The graph structure is invaluable in conveying relationship charts in textual form, anything from circuitry to train networks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hash Tables
&lt;/h2&gt;

&lt;p&gt;A hash table is a dictionary-like data structure, where keys are paired with values. Hash tables are great for rapid retrieval and modification of data, though the array and list-like objects above are better for storage. Still, especially with the explosive growth of data, hash tables have become nearly ubiquitous. For example, popular NoSQL databases used in the web such as MongoDB and Redis are distributed hash tables and key/value stores. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References;&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://www.springboard.com/blog/software-engineering/data-structures-and-algorithms-in-javascript/"&gt;https://www.springboard.com/blog/software-engineering/data-structures-and-algorithms-in-javascript/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.educative.io/blog/javascript-data-structures"&gt;https://www.educative.io/blog/javascript-data-structures&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>algorithms</category>
      <category>datastructures</category>
      <category>javascripdatastructures</category>
    </item>
    <item>
      <title> Introduction to Data Structures and Algorithms with Python</title>
      <dc:creator>MMK2020</dc:creator>
      <pubDate>Sun, 20 Feb 2022 12:16:15 +0000</pubDate>
      <link>https://dev.to/mmk2020/introduction-to-data-structures-and-algorithms-with-python-175j</link>
      <guid>https://dev.to/mmk2020/introduction-to-data-structures-and-algorithms-with-python-175j</guid>
      <description>&lt;h2&gt;
  
  
  What are data structures?
&lt;/h2&gt;

&lt;p&gt;A data structure is a method for storing and organizing data in a virtual system. It is used to denote a particular way of organizing data for particular types of operation such as modification, navigation, and access of information.  &lt;/p&gt;

&lt;p&gt;There are numerous data structures ranging from arrays and lists to more complex structures such as trees, heaps and graphs. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data structures help to:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Manage and utilize large datasets&lt;/li&gt;
&lt;li&gt;Quickly search for particular data from a database&lt;/li&gt;
&lt;li&gt;Build clear hierarchical or relational connections between data points&lt;/li&gt;
&lt;li&gt;Simplify and speed up data processing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each data structure has a task or situation it is most suited to solve. &lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Widely used basic data structures: *&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Arrays&lt;/li&gt;
&lt;li&gt;Linked lists&lt;/li&gt;
&lt;li&gt;Stacks &lt;/li&gt;
&lt;li&gt;Queues&lt;/li&gt;
&lt;li&gt;Hash tables&lt;/li&gt;
&lt;li&gt;Trees &lt;/li&gt;
&lt;li&gt;Graphs &lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What is an algorithm?
&lt;/h2&gt;

&lt;p&gt;An algorithm for a particular task is a finite sequence of instructions, each of which has a clear meaning and can be performed with a finite amount of effort in a finite length of time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Some common categories of algorithms are:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Searching &lt;/li&gt;
&lt;li&gt;Sorting&lt;/li&gt;
&lt;li&gt;Graph/tree traversing&lt;/li&gt;
&lt;li&gt;Dynamic programming&lt;/li&gt;
&lt;li&gt;Hashing and regex (string pattern matching)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Why data structures and algorithms
&lt;/h2&gt;

&lt;p&gt;When solving real-world coding problems, it is required that runtime and resource efficiency are achieved. Knowing the data structure and algorithm which best fits the current solution will increase program performance and reduce time required to make it. &lt;br&gt;
Proper understanding of data structures and algorithms ensures well-optimized and efficient code. &lt;/p&gt;

&lt;p&gt;The efficiency or performance (complexity) of an algorithm relates to the resources required by it, such as how quickly it will run (time complexity), or how much computer memory (space complexity) it will use.&lt;/p&gt;

&lt;p&gt;The ability to formulate an efficient algorithm depends on being able to organize the data in an appropriate manner. It is for this reason coding some coding interviews ask for demonstration of comprehension of data structures and algorithms.&lt;/p&gt;
&lt;h2&gt;
  
  
  Python Data Structures
&lt;/h2&gt;

&lt;p&gt;There are four main types of data structures (Lists, Tuples, Sets, and Dictionaries) that come by default in Python and don’t need to be imported from user libraries.&lt;/p&gt;

&lt;p&gt;There are four collection data types in the Python programming language:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;List is a collection which is ordered and changeable. Allows duplicate members.&lt;/li&gt;
&lt;li&gt;Tuple is a collection which is ordered and unchangeable. Allows duplicate members.&lt;/li&gt;
&lt;li&gt;Set is a collection which is unordered and unindexed. No duplicate members.&lt;/li&gt;
&lt;li&gt;Dictionary is a collection which is ordered* and changeable. No duplicate members. (*for python 3.7 and above)&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Arrays in Python
&lt;/h2&gt;

&lt;p&gt;An array is a collection of similar items which are indexed.&lt;br&gt;
Python does not have a built in array type, but an array can be implemented using the inbuilt Python List. &lt;br&gt;
An array is a collection of values of the same type saved under the same name. Each value in the array is called an “element” and indexing that represents its position. You can access specific elements by calling the array name with the desired element’s index. You can also get the length of an array using the &lt;code&gt;len()&lt;/code&gt; method.&lt;/p&gt;
&lt;h2&gt;
  
  
  Queues in Python
&lt;/h2&gt;

&lt;p&gt;Queues are a linear data structure that store data in a “first in, first out” (FIFO) order. Unlike arrays, you cannot access elements by index and instead can only pull the next oldest element. This makes it great for order-sensitive tasks like online order processing or voicemail storage.&lt;/p&gt;

&lt;p&gt;In programming terms, putting items in the queue is called enqueue, and removing items from the queue is called dequeue.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;append()&lt;/code&gt; and &lt;code&gt;pop()&lt;/code&gt; methods can be used to implement a queue. However, this is inefficient because lists must shift all elements by one index whenever you add a new element to the beginning.&lt;br&gt;
Instead, use the &lt;code&gt;deque&lt;/code&gt; class from Python’s collections module. Deques are optimized for the append and pop operations. The deque implementation also allows you to create double-ended queues, which can access both sides of the queue through the popleft() and popright() methods.&lt;br&gt;
from collections import deque&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Initializing a queue
q = deque()

# Adding elements to a queue
q.append('a')
q.append('b')
q.append('c')

print("Initial queue")
print(q)

# Removing elements from a queue
print("\nElements dequeued from the queue")
print(q.popleft())
print(q.popleft())
print(q.popleft())

print("\nQueue after removing elements")
print(q)

# Uncommenting q.popleft()
# will raise an IndexError
# as queue is now empty

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Stacks in Python
&lt;/h2&gt;

&lt;p&gt;Stacks are a sequential data structure that act as the Last-in, First-out (LIFO) version of queues. The last element inserted in a stack is considered at the top of the stack and is the only accessible element. To access a middle element, you must first remove enough elements to make the desired element the top of the stack.&lt;/p&gt;

&lt;p&gt;Adding elements is known as a push, and removing elements is known as a pop. You can implement stacks in Python using the built-in list structure. With list implementation, push operations use the &lt;code&gt;append()&lt;/code&gt;method, and pop operations use &lt;code&gt;pop()&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;stack = []

# append() function to push
# element in the stack
stack.append('a')
stack.append('b')
stack.append('c')

print('Initial stack')
print(stack)

# pop() function to pop
# element from stack in 
# LIFO order
print('\nElements popped from stack:')
print(stack.pop())
print(stack.pop())
print(stack.pop())

print('\nStack after elements are popped:')
print(stack)

# uncommenting print(stack.pop())  
# will cause an IndexError 
# as the stack is now empty


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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Linked lists in Python
&lt;/h2&gt;

&lt;p&gt;Linked lists are a sequential collection of data that uses relational pointers on each data node to link to the next node in the list.&lt;/p&gt;

&lt;p&gt;Unlike arrays, linked lists do not have objective positions in the list. Instead, they have relational positions based on their surrounding nodes.&lt;/p&gt;

&lt;p&gt;The first node in a linked list is called the head node, and the final is called the tail node, which has a null pointer.&lt;/p&gt;

&lt;p&gt;Linked lists can be singly or doubly linked depending if each node has just a single pointer to the next node or if it also has a second pointer to the previous node.&lt;/p&gt;

&lt;p&gt;You can think of linked lists like a chain; individual links only have a connection to their immediate neighbours but all the links together form a larger structure.&lt;/p&gt;

&lt;p&gt;Python does not have a built-in implementation of linked lists and therefore requires that you implement a Node class to hold a data value and one or more pointers.&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, dataval=None):
        self.dataval = dataval
        self.nextval = None

class SLinkedList:
    def __init__(self):
        self.headval = None

list1 = SLinkedList()
list1.headval = Node("Mon")
e2 = Node("Tue")
e3 = Node("Wed")
# Link first Node to second node
list1.headval.nextval = e2

# Link second Node to third node
e2.nextval = e3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Linked lists are primarily used to create advanced data structures like graphs and trees or for tasks that require frequent addition/deletion of elements across the structure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Circular linked lists in Python
&lt;/h2&gt;

&lt;p&gt;The primary downside of the standard linked list is that you always have to start at the Head node.&lt;/p&gt;

&lt;p&gt;The circular linked list fixes this problem by replacing the Tail node’s null pointer with a pointer back to the Head node. When traversing, the program will follow pointers until it reaches the node it started on.&lt;/p&gt;

&lt;p&gt;The advantage of this setup is that you can start at any node and traverse the whole list. It also allows you to use linked lists as a loopable structure by setting a desired number of cycles through the structure.&lt;/p&gt;

&lt;p&gt;Circular linked lists are great for processes that loop for a long time like CPU allocation in operating systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trees in Python
&lt;/h2&gt;

&lt;p&gt;Trees are another relation-based data structure, which specialize in representing hierarchical structures. Used to implement top searching and sorting algorithms like binary search trees and binary heap. &lt;/p&gt;

&lt;p&gt;Like a linked list, they’re populated with Node objects that contain a data value and one or more pointers to define its relation to immediate nodes.&lt;/p&gt;

&lt;p&gt;Each tree has a root node that all other nodes branch off from. The root contains pointers to all elements directly below it, which are known as its child nodes. These child nodes can then have child nodes of their own. Binary trees cannot have nodes with more than two child nodes.&lt;/p&gt;

&lt;p&gt;Any nodes on the same level are called sibling nodes. Nodes with no connected child nodes are known as leaf nodes.&lt;/p&gt;

&lt;p&gt;The most common application of the binary tree is a binary search tree. Binary search trees excel at searching large collections of data, as the time complexity depends on the depth of the tree rather than the number of nodes.&lt;/p&gt;

&lt;p&gt;Binary search trees have four strict rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The left subtree contains only nodes with elements lesser than the root.&lt;/li&gt;
&lt;li&gt;The right subtree contains only nodes with elements greater than the root.&lt;/li&gt;
&lt;li&gt;Left and right subtrees must also be a binary search tree. They must follow the above rules with the “root” of their tree.&lt;/li&gt;
&lt;li&gt;There can be no duplicate nodes, i.e. no two nodes can have the same value.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Graphs in Python
&lt;/h2&gt;

&lt;p&gt;Graphs are a data structure used to represent a visual of relationships between data vertices (the Nodes of a graph). The links that connect vertices together are called edges.&lt;/p&gt;

&lt;p&gt;Edges define which vertices are connected but does not indicate a direction flow between them. Each vertex has connections to other vertices which are saved on the vertex as a comma-separated list.&lt;/p&gt;

&lt;p&gt;Graphs are excellent for modelling networks or web-like structures. Can also be used to model social network sites like Facebook&lt;/p&gt;

&lt;p&gt;There are also special graphs called directed graphs that define a direction of the relationship, similar to a linked list. Directed graphs are helpful when modelling one-way relationships or a flowchart-like structure.&lt;/p&gt;

&lt;p&gt;They’re primarily used to convey visual web-structure networks in code form. These structures can model many different types of relationships like hierarchies, branching structures, or simply be an unordered relational web. The versatility and intuitiveness of graphs makes them a favourite for data science.&lt;/p&gt;

&lt;p&gt;When written in plain text, graphs have a list of vertices (nodes) and edges:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;V = {a, b, c, d, e}
E = {ab, ac, bd, cd, de}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In Python, graphs are best implemented using a dictionary with the name of each vertex as a key and the edges list as the values.&lt;/p&gt;

&lt;h1&gt;
  
  
  Create the dictionary with graph elements
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;graph = { "a" : ["b","c"],
                 "b" : ["a", "d"],
                 "c" : ["a", "d"],
                  "d" : ["e"],
                  "e" : ["d"]
         }

# Print the graph          
print(graph)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Hash tables in Python
&lt;/h2&gt;

&lt;p&gt;Hash tables are a complex data structure capable of storing large amounts of information and retrieving specific elements efficiently.&lt;/p&gt;

&lt;p&gt;This data structure uses key/value pairs, where the key is the name of the desired element and the value is the data stored under that name.&lt;/p&gt;

&lt;p&gt;Each input key goes through a hash function that converts it from its starting form into an integer value, called a hash. Hash functions must always produce the same hash from the same input, must compute quickly, and produce fixed-length values. Python includes a built-in hash() function that speeds up implementation.&lt;br&gt;
The table then uses the hash to find the general location of the desired value, called a storage bucket. The program then only has to search this subgroup for the desired value rather than the entire data pool.&lt;/p&gt;

&lt;p&gt;Beyond this general framework, hash tables can be very different depending on the application. Some may allow keys from different data types, while some may have differently setup buckets or different hash functions.&lt;/p&gt;

&lt;p&gt;Here is an example of a hash table in Python code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pprint
class Hashtable:
    def __init__(self, elements):
        self.bucket_size = len(elements)
        self.buckets = [[] for i in range(self.bucket_size)]
        self._assign_buckets(elements)
    def _assign_buckets(self, elements):
        for key, value in elements: #calculates the hash of each key
            hashed_value = hash(key)
            index = hashed_value % self.bucket_size # positions the element in the bucket using hash
            self.buckets[index].append((key, value)) #adds a tuple in the bucket
    def get_value(self, input_key):
        hashed_value = hash(input_key)
        index = hashed_value % self.bucket_size
        bucket = self.buckets[index]
        for key, value in bucket:
            if key == input_key:
                return(value)
        return None
    def __str__(self):
        return pprint.pformat(self.buckets) # pformat returns a printable representation of the object
if __name__ == "__main__":
     capitals = [
        ('France', 'Paris'),
        ('United States', 'Washington D.C.'),
        ('Italy', 'Rome'),
        ('Canada', 'Ottawa')
    ]
hashtable = Hashtable(capitals)
print(hashtable)
print(f"The capital of Italy is {hashtable.get_value('Italy')}")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.springboard.com/library/software-engineering/data-structures-and-algorithms-in-python/"&gt;https://www.springboard.com/library/software-engineering/data-structures-and-algorithms-in-python/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.springboard.com/library/software-engineering/data-structures-and-algorithms/#:%7E:text=A%20data%20structure%20is%20a,it%20into%20a%20target%20output"&gt;https://www.springboard.com/library/software-engineering/data-structures-and-algorithms/#:~:text=A%20data%20structure%20is%20a,it%20into%20a%20target%20output&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.educative.io/blog/8-python-data-structures"&gt;https://www.educative.io/blog/8-python-data-structures&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>python</category>
      <category>algorithms</category>
      <category>datastructures</category>
      <category>pythondatastructures</category>
    </item>
    <item>
      <title> Introduction to Modern JavaScript</title>
      <dc:creator>MMK2020</dc:creator>
      <pubDate>Sun, 13 Feb 2022 18:13:56 +0000</pubDate>
      <link>https://dev.to/mmk2020/introduction-to-modern-javascript-5a50</link>
      <guid>https://dev.to/mmk2020/introduction-to-modern-javascript-5a50</guid>
      <description>&lt;p&gt;JavaScript (JS) is a lightweight, interpreted, prototype-based, multi-paradigm, single-threaded, dynamic language, supporting object-oriented, imperative, and declarative programming styles.&lt;br&gt;
JavaScript is used on web browsers for client-side but can be also used on the server-side.&lt;/p&gt;

&lt;p&gt;Each browser runs a JavaScript engine, the most common is V8 engine. This tutorial code will be run and tested on the browser debugger console.&lt;/p&gt;

&lt;p&gt;To get started download and install VS Code and NodeJS. Once installed you are ready to go.&lt;/p&gt;
&lt;h2&gt;
  
  
  Output
&lt;/h2&gt;

&lt;p&gt;JavaScript can "display" data in different ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Writing into an HTML element, using innerHTML.&lt;/li&gt;
&lt;li&gt;Writing into the HTML output using document.write().&lt;/li&gt;
&lt;li&gt;Writing into an alert box, using window.alert().&lt;/li&gt;
&lt;li&gt;Writing into the browser console, using console.log().&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This tutorial will be printing to browser console window.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(“Hello, World!”); //Prints Hello, World! to the debugger console

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

&lt;/div&gt;



&lt;p&gt;JS doesn’t need semicolon at the end of code line they are optional&lt;/p&gt;

&lt;p&gt;For strings they can be enclosed with single or double quotes&lt;/p&gt;

&lt;h2&gt;
  
  
  Variables
&lt;/h2&gt;

&lt;p&gt;JavaScript uses the keywords &lt;code&gt;var&lt;/code&gt;, &lt;code&gt;let&lt;/code&gt; and &lt;code&gt;const&lt;/code&gt; to declare variables.&lt;br&gt;
An equal sign is used to assign values to variables.&lt;br&gt;
Lower camelCase highly recommended for variable names and should have meaning: firstName, lastName, masterCard, interCity.&lt;/p&gt;

&lt;p&gt;4 Ways to Declare a JavaScript Variable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using var&lt;/li&gt;
&lt;li&gt;Using let&lt;/li&gt;
&lt;li&gt;Using const&lt;/li&gt;
&lt;li&gt;Using nothing
A variable declared without a value will have the value undefined. E.g. &lt;code&gt;let carName&lt;/code&gt;;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A JavaScript name must begin with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A letter (A-Z or a-z)&lt;/li&gt;
&lt;li&gt;A dollar sign ($)&lt;/li&gt;
&lt;li&gt;Or an underscore (_)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  JavaScript &lt;code&gt;Let&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The let keyword was introduced in ES6 (2015).&lt;br&gt;
Variables defined with let cannot be Redeclared.&lt;br&gt;
Variables defined with let must be Declared before use.&lt;br&gt;
Variables defined with let have Block Scope.&lt;/p&gt;
&lt;h2&gt;
  
  
  JavaScript &lt;code&gt;const&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;const&lt;/code&gt; keyword was introduced in ES6 (2015).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Variables defined with &lt;code&gt;const&lt;/code&gt; cannot be Redeclared.&lt;/li&gt;
&lt;li&gt;Variables defined with &lt;code&gt;const&lt;/code&gt; cannot be Reassigned.&lt;/li&gt;
&lt;li&gt;Variables defined with &lt;code&gt;const&lt;/code&gt; have Block Scope.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It does not define a constant value. It defines a constant reference to a value.&lt;br&gt;
As a general rule, always declare a variable with &lt;code&gt;const&lt;/code&gt; unless you know that the value will change.&lt;/p&gt;

&lt;p&gt;Use &lt;code&gt;const&lt;/code&gt; when you declare:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A new Array&lt;/li&gt;
&lt;li&gt;A new Object&lt;/li&gt;
&lt;li&gt;A new Function&lt;/li&gt;
&lt;li&gt;A new RegExp&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Data type
&lt;/h2&gt;

&lt;p&gt;String, number, boolean, object, undefined&lt;br&gt;
typeof keyword is used indicate the type of a variable&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var  num = 23
var hello = “hello”
var isLate = “true”
var empty = undefined;
var dob = new Date(1973,8,28);
var person = {};
console.log(typeof num);// prints number to console
console.log(typeof hello); // prints string to console
console.log(typeof isLate); // prints boleean to console
console.log(typeof dob); // prints object to console
console.log(typeof person); // prints object to console
console.log(typeof empty); // prints undefined to console

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Strings
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var brand = "Shekey";
console.log(typeof brand); // prints string
console.log(brand.length); //  prints 6
console.log(brand.toUpperCase()); // prints SHEKEY
console.log(brand.substring(0,4)); // prints Shek

var a = "She";
var b = "key";
console.log(a + b); // prints Shekey
console.log(a +" "+ b); // prints She Key
console.log(`${a}${b}`);// backticks ` ` in use prints Shekey
console.log(`${a}  ${b}`);// backticks ` ` in use prints She  key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Type Conversion
&lt;/h2&gt;

&lt;p&gt;JavaScript variables can be converted to a new variable and another data type:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;By the use of a JavaScript function&lt;/li&gt;
&lt;li&gt;Automatically by JavaScript itself
&lt;code&gt;Number()&lt;/code&gt; Returns a number, converted from its argument
&lt;code&gt;parseFloat()&lt;/code&gt; Parses a string and returns a floating point number
&lt;code&gt;parseInt()&lt;/code&gt;   Parses a string and returns an integer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The global method &lt;code&gt;String()&lt;/code&gt; can convert numbers to strings.&lt;br&gt;
It can be used on any type of numbers, literals, variables, or expressions:&lt;br&gt;
The Number method &lt;code&gt;toString()&lt;/code&gt; does the same.&lt;/p&gt;
&lt;h2&gt;
  
  
  JavaScript Objects
&lt;/h2&gt;

&lt;p&gt;JavaScript objects are written with curly braces {}.&lt;br&gt;
Object properties are written as key:value pairs, separated by commas.&lt;br&gt;
An object is a collection of properties&lt;br&gt;
You can access object properties in two ways:&lt;br&gt;
objectName.propertyName&lt;br&gt;
or&lt;br&gt;
objectName["propertyName"]&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var person = {
    firstname: "Martin",
    age: 47,
    isMale: true,
    balance: 453.435,
    dob: new Date(1973, 1, 28).toJSON(),
    address: {
        city: "Nairobi",
        postCode: "00100"
    }
};

console.log(person);
console.log(person.firstname);
console.log(person.age)
console.log(person.balance);

console.log(person.address);
console.log(person.address.city);
console.log(Object.values(person));
console.log(Object.keys(person));
console.log(JSON.stringify(person));

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Boolean
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Boolean takes on a true of false value
var isAdult = true;
console.log(isAdult); // prints true
The ! operator can be used to negate (i.e. flip) the value 
console.log(!isAdult); //prints false
console.log(!true); //print false
console.log(!false) // prints true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Arrays
&lt;/h2&gt;

&lt;p&gt;JavaScript arrays are written with square brackets.&lt;br&gt;
Array items are separated by commas.&lt;br&gt;
Used for storing multiple values&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Arrays
var names = [
    "Alex", 
    "Joe", 
    "Ann", 
    "Mike"
];

console.log(names); // prints [‘Alex’, ‘Joe’, ‘Ann’, ‘Mike’]
console.log(names[0]); // prints Alex
console.log(names[1]); // prints Joe
console.log(names[2]); // prints Ann
console.log(names[3]); // prints Mike
console.log(names.length); // prints length of arrar i.e. 4

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Arithmetic Operators
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Arithmetic Operators
var addition = 2 + 2;
var subtraction = 2- 2;
var division = 10/2;
var multiplication = 10*2;
var remainder = 10%2;
var exponentation = 3**4

console.log(addition);
console.log(subtraction);
console.log(division);
console.log(multiplication);
console.log(remainder);
console.log(exponentation);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Functions
&lt;/h2&gt;

&lt;p&gt;A JavaScript function is defined with the &lt;code&gt;function&lt;/code&gt; keyword, followed by a name, followed by parentheses &lt;code&gt;()&lt;/code&gt;. Function names can contain letters, digits, underscores, and dollar signs (same rules as variables). The parentheses may include parameter names separated by commas:&lt;br&gt;
(parameter1, parameter2, ...)&lt;br&gt;
The code to be executed, by the function, is placed inside curly brackets: &lt;code&gt;{ }&lt;/code&gt;&lt;br&gt;
A collection of statements that perform a task or calculate a value&lt;br&gt;
Function parameters are listed inside the parentheses () in the function definition.&lt;br&gt;
Function arguments are the values received by the function when it is invoked.&lt;br&gt;
Inside the function, the arguments (the parameters) behave as local variables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Functions
function addNumbers(){
    var addition = 2 + 5;
    console.log(addition);
};

  addNumbers();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A function may or may not have parameters
// Functions
function addNumbers(number1, number2){
    var addition = number1 + number2;
    return addition;
};

var result1 = addNumbers(2,5);
var result2 =  addNumbers(7,5);

console.log(result1); // prints 7

console.log(result2); // prints 12

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Arrow Function
&lt;/h2&gt;

&lt;p&gt;Arrow functions were introduced in ES6.&lt;br&gt;
Arrow functions allow us to write shorter function syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let myFunction = (a, b) =&amp;gt; a * b;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hello = () =&amp;gt; {
  return "Hello World!";
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hello = () =&amp;gt; "Hello World!";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Loops
&lt;/h2&gt;

&lt;p&gt;Used to repeat a piece of code over and over until a condition is met&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Loops
for (var i=0; i&amp;lt;=10; i++){
    console.log(i);
}

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Looping an array
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Loops
var names = [
    "Alex",
    "John",
    "Mary",
    "Joe"
];
for (var i=0; i&amp;lt;names.length; i++){
    console.log(names[i]);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;code&gt;for&lt;/code&gt; of and &lt;code&gt;foreach&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Loops
var names = [
    "Alex",
    "John",
    "Mary",
    "Joe"
];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// for of
for (const name of names) {
    console.log(name);
}

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

&lt;/div&gt;





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

names.forEach(function(name) {
    console.log(name);
});

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;code&gt;while&lt;/code&gt; loop
&lt;/h2&gt;

&lt;p&gt;Repeats code until a certain condition is false&lt;br&gt;
&lt;/p&gt;

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

var names = [
"Alex",
"John",
"Mary",
"Joe",
"Bob"
];
var index = 0;
while(index&amp;lt;names.length){
    console.log(names[index]);
    index+=1;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;code&gt;do while&lt;/code&gt; loop
&lt;/h2&gt;

&lt;p&gt;Loops at least once no matter the condition&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;do {

    } while(true);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;break&lt;/code&gt; and &lt;code&gt;continue&lt;/code&gt; keywords can be used within loops to terminate or go back to start of loop respectively.&lt;/p&gt;

&lt;h2&gt;
  
  
  Increment and Decrement operators (&lt;code&gt;++&lt;/code&gt; and &lt;code&gt;--&lt;/code&gt;)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Num++ // Increments but returns the number before the increment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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;// Postfix
var number = 0;
console.log(number++); // prints 0
console.log(number); // prints 1
// Prefix increments/decrements  and returns the number
Var numberTwo  = 0;
console.log(++numberTwo); // Prints 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Comparison Operators
&lt;/h2&gt;

&lt;p&gt;Evaluates values(numbers, strings, objects) and returns true or false&lt;br&gt;
&lt;code&gt;&amp;lt; ,!=, &amp;lt;= , &amp;gt;, &amp;gt;=, ==&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Logical Operators
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;&amp;amp;&amp;amp;, ||, !&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;code&gt;if&lt;/code&gt; statements
&lt;/h2&gt;

&lt;p&gt;Allows execution of code based on a conditions &lt;br&gt;
&lt;code&gt;if( ){ }&lt;/code&gt;&lt;br&gt;
&lt;code&gt;if ( ) { } else{ }&lt;/code&gt;&lt;br&gt;
&lt;code&gt;if ( ) { } else if ( ) { } else { }&lt;/code&gt;&lt;br&gt;
You can have as much &lt;code&gt;else if ( ) { }&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Ternary Statement &lt;code&gt;? :&lt;/code&gt;
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var number = 6;
var result = number % 2 ==0 ?"Even":"Odd";
console.log(result)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;switch&lt;/code&gt; statement
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var gender = “M”;
switch(gender){
case “M”:
break;
case “F”:
break;
default:

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

&lt;/div&gt;

&lt;h2&gt;
  
  
  Hoisting
&lt;/h2&gt;

&lt;p&gt;Hoisting is JavaScript's default behaviour of moving all declarations to the top of the current scope (to the top of the current script or the current function).&lt;br&gt;
Accessing a variable outside its scope.&lt;br&gt;
Use &lt;code&gt;let&lt;/code&gt; or &lt;code&gt;const&lt;/code&gt; key words to declare variables to avoid hoisting. Avoid &lt;code&gt;var&lt;/code&gt; keyword.&lt;br&gt;
const prevents the variable from being reassigned&lt;/p&gt;
&lt;h2&gt;
  
  
  JavaScript Classes
&lt;/h2&gt;

&lt;p&gt;Use the keyword &lt;code&gt;class&lt;/code&gt; to create a class.&lt;br&gt;
Always add a method named &lt;code&gt;constructor()&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class ClassName {
  constructor() { ... }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A JavaScript class is not an object.&lt;br&gt;
It is a template for JavaScript objects.&lt;br&gt;
The constructor method is a special method:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It has to have the exact name "constructor"&lt;/li&gt;
&lt;li&gt;It is executed automatically when a new object is created&lt;/li&gt;
&lt;li&gt;It is used to initialize object properties&lt;/li&gt;
&lt;li&gt;If you do not define a constructor method, JavaScript will add an empty constructor method.
Use the keyword &lt;code&gt;class&lt;/code&gt; to create a class.
Always add a &lt;code&gt;constructor()&lt;/code&gt; method.
Then add any number of methods.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let myCar1 = new Car("Ford", 2014);
let myCar2 = new Car("Audi", 2019);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Car {
  constructor(name, year) {
    this.name = name;
    this.year = year;
  }
}
class Car {
  constructor(name, year) {
    this.name = name;
    this.year = year;
  }
  age() {
    let date = new Date();
    return date.getFullYear() - this.year;
  }
}

let myCar = new Car("Ford", 2014);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  JSON
&lt;/h2&gt;

&lt;p&gt;JSON is a format for storing and transporting data.&lt;br&gt;
JSON is often used when data is sent from a server to a web page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is JSON?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JSON stands for &lt;strong&gt;J&lt;/strong&gt;ava*&lt;em&gt;S&lt;/em&gt;&lt;em&gt;cript **O&lt;/em&gt;&lt;em&gt;bject **N&lt;/em&gt;*otation&lt;/li&gt;
&lt;li&gt;JSON is a lightweight data interchange format&lt;/li&gt;
&lt;li&gt;JSON is language independent *&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JSON is "self-describing" and easy to understand&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The JSON syntax is derived from JavaScript object notation syntax, but the JSON format is text only. Code for reading and generating JSON data can be written in any programming language.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;JSON Syntax Rules&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data is in name/value pairs&lt;/li&gt;
&lt;li&gt;Data is separated by commas&lt;/li&gt;
&lt;li&gt;Curly braces hold objects&lt;/li&gt;
&lt;li&gt;Square brackets hold arrays&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;JSON Objects&lt;/strong&gt;&lt;br&gt;
JSON objects are written inside curly braces.&lt;br&gt;
Just like in JavaScript, objects can contain multiple name/value pairs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{"firstName":"John", "lastName":"Doe"}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;JSON Arrays&lt;/strong&gt;&lt;br&gt;
JSON arrays are written inside square brackets.&lt;br&gt;
Just like in JavaScript, an array can contain objects:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"employees":[
  {"firstName":"John", "lastName":"Doe"},
  {"firstName":"Anna", "lastName":"Smith"},
  {"firstName":"Peter", "lastName":"Jones"}
]

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

&lt;/div&gt;



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

&lt;ol&gt;
&lt;li&gt;Amigoscode YouTube Channel&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;w3schools.com&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Introduction to Modern Python</title>
      <dc:creator>MMK2020</dc:creator>
      <pubDate>Sat, 12 Feb 2022 15:54:03 +0000</pubDate>
      <link>https://dev.to/mmk2020/introduction-to-modern-python-114d</link>
      <guid>https://dev.to/mmk2020/introduction-to-modern-python-114d</guid>
      <description>&lt;p&gt;Wikipedia states that the Python programming language is an interpreted high-level general-purpose programming language that is dynamically-typed and garbage-collected. It supports multiple programming paradigms, including procedural object-oriented and functional programming.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started with Python
&lt;/h2&gt;

&lt;p&gt;Getting started with Python is as easy as downloading and installing the. Python interpreter&lt;br&gt;
Download the latest stable release for your operating system from &lt;a href="https://www.python.org/downloads/"&gt;https://www.python.org/downloads/&lt;/a&gt;&lt;br&gt;
After installing run the python interpreter from the terminal by typing the word python&lt;/p&gt;

&lt;p&gt;If successful you should get something likes shown below;&lt;br&gt;
Python 3.9.4 (tags/v3.9.4:1f2e308, Apr  6 2021, 13:40:21) [MSC v.1928 64 bit (AMD64)] on win32&lt;br&gt;
Type "help", "copyright", "credits" or "license" for more information&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Introduction to python program structure&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Input/Output (I/O) in python
&lt;/h2&gt;

&lt;p&gt;The input() and print() functions are used for accepting and displaying data on the terminal respectively.&lt;br&gt;
Accepting user input using input() function and converts it into a string. To change value use typecasting&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;name = input(‘Enter name’)&lt;br&gt;
print(“Your name is: " + name)&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;

&lt;p&gt;To convert input to integer, float, list, tuple etc. Use the following examples i.e. casting&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;num = int(input("Enter a number:"))&lt;br&gt;
num =float(input("Enter number "))&lt;br&gt;
li =list(input("Enter number "))&lt;br&gt;
num =tuple(input("Enter number "))`&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Variables and Datatypes
&lt;/h2&gt;

&lt;p&gt;Variables can store data of different types, and different types can do different things&lt;/p&gt;

&lt;h2&gt;
  
  
  Operators
&lt;/h2&gt;

&lt;p&gt;The operators &lt;strong&gt;+, -, *** and **/&lt;/strong&gt; work just like in most other languages (for example, Pascal or C); parentheses (()) can be used for grouping&lt;br&gt;
Division (&lt;strong&gt;/&lt;/strong&gt;) always returns a float. To do floor division and get an integer result (discarding any fractional result) you can use the &lt;strong&gt;//&lt;/strong&gt; operator; to calculate the remainder you can use %:&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;17 / 3  # classic division returns a float&lt;br&gt;
5.666666666666667&lt;br&gt;
17 // 3  # floor division discards the fractional part&lt;br&gt;
5&lt;br&gt;
17 % 3  # the % operator returns the remainder of the division&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Operator&lt;/strong&gt;        &lt;strong&gt;Name&lt;/strong&gt;        &lt;strong&gt;Example&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;==            Equal               x == y
&lt;/li&gt;
&lt;li&gt;!=            Not equal           x != y
&lt;/li&gt;
&lt;li&gt;&amp;gt;         Greater than            x &amp;gt; y
&lt;/li&gt;
&lt;li&gt;&amp;lt;         Less than           x &amp;lt; y
&lt;/li&gt;
&lt;li&gt;&amp;gt;=            Greater than or equal to    x &amp;gt;= y
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&amp;lt;=            Less than or equal to       x &amp;lt;= y&lt;br&gt;
&lt;strong&gt;Operator&lt;/strong&gt;    &lt;strong&gt;Description&lt;/strong&gt;         &lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;and Returns True if both statements are true x &amp;lt; 5 and  x &amp;lt; 10    &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;or Returns True if one of the statements is true x &amp;lt; 5 or x &amp;lt; 4   &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;not Reverse the result, returns False if the result is true   not(x &amp;lt; 5 and x &amp;lt; 10)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Lists, Tuples, Sets and Dictionaries
&lt;/h2&gt;

&lt;p&gt;There are four collection data types in the Python programming language:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;List is a collection which is ordered and changeable. Allows duplicate members.&lt;/li&gt;
&lt;li&gt;Tuple is a collection which is ordered and unchangeable. Allows duplicate members.&lt;/li&gt;
&lt;li&gt;Set is a collection which is unordered and unindexed. No duplicate members.&lt;/li&gt;
&lt;li&gt;Dictionary a set of key: value pairs, with the requirement that the keys are unique (within one dictionary) It is ordered* and changeable. No duplicate members. (*for python 3.7 and above)&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;fruits= [‘Apple’, ’Mango’, ’Banana’]  #List&lt;/li&gt;
&lt;li&gt;fruits =(‘Apple’, ’Mango’, ’Banana’)  #Tuple&lt;/li&gt;
&lt;li&gt;basket = {'orange', 'apple', 'pear', 'banana'}#Set&lt;/li&gt;
&lt;li&gt;a = {‘name’:’John’, ’surname’:’Ford’} #Dictionary&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conditionals
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;if b &amp;gt; a:&lt;br&gt;
    print("b is greater than a")&lt;br&gt;
if b &amp;gt; a:&lt;br&gt;
      print("b is greater than a")&lt;br&gt;
     elif a == b:&lt;br&gt;
        print("a and b are equal&lt;br&gt;
if b &amp;gt; a:&lt;br&gt;
  print("b is greater than a")&lt;br&gt;
    elif a == b:&lt;br&gt;
    print("a and b are equal")&lt;br&gt;
    else:&lt;br&gt;
    print("a is greater than b")&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;There can be zero or more elif parts, and the else part is optional. &lt;/li&gt;
&lt;li&gt;The keyword elif is short for ‘else if’, and is useful to avoid excessive indentation. &lt;/li&gt;
&lt;li&gt;An if … elif … elif … sequence is a substitute for the switch or case statements found in other languages.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Loops
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;for&lt;/code&gt; statement&lt;/strong&gt;&lt;br&gt;
Python’s for statement iterates over the items of any sequence (a list or a string), in the order that they appear in the sequence&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;# Measure some strings:&lt;/code&gt;&lt;br&gt;
... words = ['cat', 'window', 'defenestrate']&lt;br&gt;
for w in words:&lt;br&gt;
...     print(w, len(w))&lt;br&gt;
...&lt;br&gt;
cat 3&lt;br&gt;
window 6&lt;br&gt;
defenestrate 12&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;

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

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;count = 0&lt;br&gt;
while (count&amp;lt;5):&lt;br&gt;
    count = count + 1&lt;br&gt;
    print("Hello there!")&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Functions
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A function is a block of code which only runs when it is called.&lt;/li&gt;
&lt;li&gt;You can pass data, known as parameters, into a function.&lt;/li&gt;
&lt;li&gt;A function can return data as a result.&lt;/li&gt;
&lt;li&gt;You can send any data types of argument to a function (string, number, list, dictionary etc.), and it will be treated as the same data type inside the function.
The syntax for a user defined function is as follows using the &lt;code&gt;def&lt;/code&gt; keyword;
def function_name(parameters):
#some code
return expression&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A function is invoked by declaring it as follows;&lt;br&gt;
&lt;code&gt;function name(parameters)&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;def fib(n):    # write Fibonacci series up to n&lt;br&gt;
...     a, b = 0, 1&lt;br&gt;
...     while a &amp;lt; n:&lt;br&gt;
...         print(a, end=' ')&lt;br&gt;
...         a, b = b, a+b&lt;br&gt;
...     print()&lt;br&gt;
&lt;code&gt;# Now call the function we just defined:&lt;/code&gt;&lt;br&gt;
... fib(2000)&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;
&lt;br&gt;
&lt;/blockquote&gt;

&lt;p&gt;0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597&lt;/p&gt;

&lt;h2&gt;
  
  
  Classes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Almost everything in Python is an object, with its properties and methods.&lt;/li&gt;
&lt;li&gt;A Class is like an object constructor, or a "blueprint" for creating objects.
class MyClass:  #class named MyClass, with a property named x
 x = 5
p1 = MyClass() #object named p1, and print the value of x
print(p1.x) # print the value of x&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;__init__()&lt;/code&gt; function&lt;/strong&gt;&lt;br&gt;
All classes have a function called &lt;code&gt;__init__()&lt;/code&gt;, which is always executed when the class is being initiated. The &lt;code&gt;__init__()&lt;/code&gt; function is called automatically every time the class is being used to create a new object.&lt;br&gt;
Use the &lt;code&gt;__init__()&lt;/code&gt; function to assign values to object properties, or other operations that are necessary to do when the object is being created&lt;br&gt;
&lt;code&gt;class Person:&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;def &lt;code&gt;__init__&lt;/code&gt;(self, name, age):&lt;br&gt;
    self.name = name&lt;br&gt;
    self.age = age&lt;/p&gt;

&lt;p&gt;p1 = Person("John", 36)&lt;/p&gt;

&lt;p&gt;print(p1.name)&lt;br&gt;
print(p1.age)&lt;/p&gt;

&lt;p&gt;Visit my article &lt;a href="https://dev.to/mmk2020/introduction-to-data-structures-and-algorithms-with-python-175j"&gt;Introduction to Data Structures and Algorithms with Python&lt;/a&gt; to get familiar with data structures and algorithms. Understanding &lt;strong&gt;D&lt;/strong&gt;ata &lt;strong&gt;S&lt;/strong&gt;tructures and &lt;strong&gt;A&lt;/strong&gt;lgorithms (DSA) will help you write effective and efficient programs that work optimally under given conditions in terms of speed (execution time) and memory usage.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;sources;&lt;br&gt;
en.wikipedia.org&lt;br&gt;
w3schools.com&lt;/em&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python101</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
