<?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>Forem: Brayan Kai</title>
    <description>The latest articles on Forem by Brayan Kai (@brayan_kai).</description>
    <link>https://forem.com/brayan_kai</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%2F749672%2F4dac320d-b87b-47c0-90e3-1bdb0aa786b0.jpg</url>
      <title>Forem: Brayan Kai</title>
      <link>https://forem.com/brayan_kai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/brayan_kai"/>
    <language>en</language>
    <item>
      <title>The Ultimate Guide To Getting Started In Data Science</title>
      <dc:creator>Brayan Kai</dc:creator>
      <pubDate>Sun, 03 Apr 2022 17:26:24 +0000</pubDate>
      <link>https://forem.com/brayan_kai/the-ultimate-guide-to-getting-started-in-data-science-4h9b</link>
      <guid>https://forem.com/brayan_kai/the-ultimate-guide-to-getting-started-in-data-science-4h9b</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;I dare suggest that Data Science is one of the "sexiest" careers in the twenty-first century. &lt;br&gt;
Breaking into the field of Data Science, especially one as sophisticated and multidimensional as this one, is not simple. We're in an odd era where even the concept (and expectations) of Data Science differ from one organization to the next. What data scientists perform, what they need to know, and the types of firms that need to hire data scientists are all changing rapidly.&lt;/p&gt;

&lt;p&gt;Why on earth then would there be only one path to take in the first place? I can't think of a better time to start if you're looking to break into data science. Start now!&lt;/p&gt;

&lt;p&gt;In this article, I am going to explain how one can best get started in Data Science from a personal perspective.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Goals of this article
&lt;/h2&gt;

&lt;p&gt;After reading this article the reader should  gain the following from it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The reader should be encouraged and able to kick start their journey into data science.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The reader should be able to get the best way on starting their data Science journey.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Data Science
&lt;/h2&gt;

&lt;p&gt;Peter Sondergaard, the Senior Vice President and Global head of research at Gartner,Inc once said that i*&lt;em&gt;nformation is the oil of the 21st century, and analytics is the combustion engine&lt;/em&gt;*.&lt;br&gt;
This is just a sliver of how lucrative the field of data is.&lt;/p&gt;

&lt;p&gt;Choosing to be a data scientist is a great choice not because you are going to get money from it but because you have taken a step to care for the world.&lt;br&gt;
Data Science involves changing different sad stories into grinning stories, stories we transform for the better with data.&lt;br&gt;
So choose to care and Love the planet. It's all about you caring for the people, not just users.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Data Science
&lt;/h2&gt;

&lt;p&gt;Data Science is a universally recognized term that escapes every single complete definition. It is a volatile field whose methods and goals evolve with every technological advancement. The definition of data science 30 years ago is not the same today.&lt;/p&gt;

&lt;p&gt;Since no one definition fits it let us define the key processes in data science and how they fit into each other. Acting as the building block to the bigger data science picture. &lt;br&gt;
That way I believe one will be able to visualize, understand and conceptualize what data science truly is.&lt;/p&gt;

&lt;p&gt;This also will help if one wants to be a competitive job applicant they will need to understand how various data science activities fit into the big picture as earlier stated. One will get to learn about the timing of different data processing analyses as well as who carries them out and let's not forget how. Does that make sense? &lt;/p&gt;

&lt;h2&gt;
  
  
  Data
&lt;/h2&gt;

&lt;p&gt;If you want to work in medicine, you will first learn how the human body functions and then decide whether you want to be a pediatrician or a nurse or an oncologist, etc. that is what we are about to do here but for data science.&lt;/p&gt;

&lt;p&gt;Okay, so let's get started by talking about data since Before there was anything there was data.&lt;br&gt;
Data is the foundation of Data Science. Therefore, we need to have a clearly understanding of what data is. &lt;/p&gt;

&lt;p&gt;In the context of data science there are two types of data;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Traditional Data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Traditional data is data that is structured and stored in databases that can be managed from one computer. It is in table format containing numeric and text values.&lt;br&gt;&lt;br&gt;
Traditional data may come from sources like basic customer records of a retail store or the historical price of crude oil in the middle east oil producer countries.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Big Data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Big Data on the other hand is bigger than traditional data and not in the trivial sense. It isn't simply represented by numbers or texts but also by images, audio, mobile data, and so on. In addition, big data has high velocity, this is to means that its retrieved and computed in real-time.&lt;br&gt;
And finally, think about its volume, big data is measured in tera-, Peta- and exabytes and hence often distributed into a network of computers. &lt;/p&gt;

&lt;p&gt;Big data is all around us. A consistently growing number of companies and industries generate use and generate big data. Consider online communities like tick-tock, Facebook, and LinkedIn. They generate a massive amount of user data. This is a lot of data being generated. Right now digital data in the world amounts to 3.2 zettabytes.&lt;/p&gt;

&lt;p&gt;Having known what data is and its different forms, now imagine the following scenario. &lt;/p&gt;

&lt;p&gt;You are already a data scientist professional and you are working for a private airline company. A superior member of staff tells you one of the two things below, what is the difference between the two?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We need to consider client satisfaction in the next quarter, so we can predict the churn rate. Oversee the process and come up with some numbers.&lt;/p&gt;

&lt;p&gt;We have an enormous amount of customer data from the previous quarter. Can you oversee the analysis and deliver an approximation of churn rates for the next quarter.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If You have noticed, the difference between the two is that unlike in the second case you do not have data in the first case. You will need to gather it, probably through surveys and so on.&lt;br&gt;
So you have conducted the survey and received responses. Is this data ready to be analyzed? Not Exactly.&lt;br&gt;
This is called raw data since you haven't done any processing on it. It is untouched data that cannot be analyzed straight away.&lt;br&gt;
This takes us to the next point which is Preprocessing of data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preprocessing (Preliminary Data Science)
&lt;/h2&gt;

&lt;p&gt;Preprocessing is what we can think of as preliminary data science. &lt;br&gt;
Preprocessing is a crucial group of operations that converts raw data into a format that is more understandable and hence, useful for further processing. Plus it fixes the mistakes that occurred during the gathering phase. &lt;br&gt;
Like when we are thinking about customer data, it's unrealistically easy to have a person registered as “KNO45P” years old, called “Ukraine”, flight number “Isabel Valentine ” from “32” as her country. &lt;br&gt;
Those data entries are incorrect and therefore must be handled before proceeding to any type of analysis, right?&lt;/p&gt;

&lt;p&gt;That is why there are tons of preprocessing practices in place. Will tell you about some of the common ones.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;i) Class Labelling&lt;/strong&gt;&lt;br&gt;
The first is class labeling your observations. This consists of arranging data by category or labeling data points to the correct data type. For example numerical or categorical.&lt;br&gt;
The number of passengers on a day's flight would be numerical, you can manipulate this information mathematically, and the passenger's occupation and country of origin are categorical because no mathematical operations can be done on this information.&lt;br&gt;
Just keep in mind that with big data the classes are extremely varied, therefore instead of ‘numerical’ vs ‘categorical’ the labels will be ‘text’, ‘digital image data’, ‘digital video data’, ‘digital audio data’...and so on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ii) Data Cleansing or Scrubbing&lt;/strong&gt;&lt;br&gt;
These are techniques for dealing with inconsistent data, like misspelled categories and missing values. You know a lot, of people sharing their name and occupation but omitting their age, or gender. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;iii) Data Shuffling&lt;/strong&gt;&lt;br&gt;
Data shuffling is another interesting one! Imagine shuffling a deck of cards.&lt;br&gt;
It ensures that your dataset is free from unwanted patterns caused by problematic data collection.&lt;br&gt;
For example, if the first 105 observations in your data are from the first 105 passengers who boarded the first flight of the day. This data isn't randomized and is likely to reflect just the behavior of those 105 passengers when the airline had just been rolled out.&lt;br&gt;
In a word, data shuffling prevents patterns due to sampling to emerge.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;iv) Data Masking&lt;/strong&gt;&lt;br&gt;
Finally consider data masking. This is primarily a big-data-specific technique. When collecting data on a mass scale, you can accidentally put your hands on a lot of sensitive information which you need to urgently hide from yourself.&lt;br&gt;
Masking aims to ensure that any confidential information in the data remains private, without hindering the analysis and extraction of insight.&lt;br&gt;
Essentially the process involves concealing the original data with random and false data, allowing the scientist to conduct their analyses without compromising private details.&lt;/p&gt;

&lt;p&gt;Let's not forget that all of this is just the very beginning of doing data science. Pre-processing of data to make it usable is laying the groundwork.&lt;/p&gt;

&lt;p&gt;Alright let's assume your databases are clean and organized at this point, so let's get into the real deal now&lt;/p&gt;

&lt;h2&gt;
  
  
  Looking at Data
&lt;/h2&gt;

&lt;p&gt;Before we begin I want to make sure that we all moving together.&lt;br&gt;
There are two ways of looking at data: &lt;br&gt;
One is with the intent to explain behavior that has already happened, and you have gathered data for it.&lt;/p&gt;

&lt;p&gt;The second way is to use data that you already have to predict future behavior that has not yet happened.&lt;/p&gt;

&lt;p&gt;One needs to be very clear on this distinction because it can be what tilts the scales one way or another when you are deliberating which data science path is best for you.&lt;/p&gt;

&lt;p&gt;There is also a temporal relationship between the two ways of looking at data. Before data science jumps into predictive analytics, it must look at the patterns of behavior the past provides. It must analyze them to draw insights which will then inform the direction in which forecasting should go.&lt;/p&gt;

&lt;p&gt;This brings us to the next part which is Exploratory data analysis&lt;/p&gt;

&lt;h2&gt;
  
  
  Explain first before predicting.
&lt;/h2&gt;

&lt;p&gt;In this stage the data scientist, after collecting the data and ensuring it is clean. They now take the data in three fundamental operations.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;First, extract meaningful metrics from the data set. &lt;br&gt;
For example in our airline case, the data scientist would extract the average quarterly revenue per new customer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Second, identify the Key Performance Indicators, that is only those metrics that will clearly show how the business is doing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Third, analyze the data to extract insights from it. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;So why is the Exploratory Data analysis Stage important and the data science stepping stone?&lt;/strong&gt; &lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Well, consider this; The airline company we are working for is running a marketing campaign and you have received the data. You examine it and identify one of the metrics. It indicates all the traffic to a page on the company’s website.&lt;br&gt;
Then you think about what a KPI could be in this case, and you realize that a KPI would show the volume of the traffic to the same page, but only if generated from users who have clicked on a link in your ad campaign to get there.&lt;/p&gt;

&lt;p&gt;This way you can check if the ads you are positioning are working and driving customers to click on a link, in turn, this would determine whether you should continue to spend on ads or not.&lt;br&gt;
Of course, this is not where a data scientist's responsibilities conclude. &lt;/p&gt;

&lt;p&gt;Data Science is about telling a story. I repeat Data Science is about telling a story. And crunching the numbers is just the introduction to the story. &lt;br&gt;
So apart from handling strictly numerical information, Data Science and specifically Exploratory data analysis are about visualizing the findings and creating easily digestible images supported by the most relevant numbers. &lt;br&gt;
After all levels of management should be able to understand the insights from the data and inform their decision making.&lt;br&gt;
And this is in the hands of the Data Scientist. Data Scientists create dashboards and reports, accompanied by graphs diagrams maps, and other comparable visualizations to present the findings most relevant to the current objectives.&lt;/p&gt;

&lt;p&gt;A real-life example can be as follows. Let's say you are a hotel manager would you keep the prices of rooms constant all year round? Probably not when you want to attract visitors when the tourist season is not in bloom and if you want to capitalize on it when it is.  And would you inform your strategic decision to lower or increase room prices? A data Scientist will now perform the above-mentioned processes coming up with the best strategy. &lt;/p&gt;

&lt;p&gt;Once all the work above has been done the information can now become the basis for predicting future values. This now takes us to the next part which is now Predictive Analysis&lt;/p&gt;

&lt;h2&gt;
  
  
  Predictive Analysis
&lt;/h2&gt;

&lt;p&gt;Here now is where it becomes truly awesome. Here now one can make forecasts and predictions.&lt;br&gt;
The accuracy of your forecasts though will differ based on the methods and techniques you decide to apply.&lt;br&gt;
And this is where the more popular Data Science concepts come into play. Examples of such techniques are Neural Networks, Deep Learning, Time series, and Random Forests.&lt;br&gt;
But just as there is a distinction between traditional and big data, there is also a distinction between traditional methods in predictive analytics and Machine Learning.&lt;/p&gt;

&lt;h3&gt;
  
  
  Traditional Methods In Predictive Analytics
&lt;/h3&gt;

&lt;p&gt;Traditional Data invites Traditional analytics like Linear Regression, Cluster Analysis, and Factor Analysis just to mention. &lt;/p&gt;

&lt;p&gt;So what statistical knowledge do you need for traditional analytics in Data Science?&lt;br&gt;
Most often Data Science Employs one of the below-mentioned five analyses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Linear Regression&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Logistic Regression&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cluster Analyses&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Factor Analyses&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Time Series Analysis&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;a) Linear Regression&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;This method is used for quantifying casual relationships among the different variables included in the analysis. You will use this if you need to assess the relationship between, for example, house prices, the size of the house, and the year they were built.&lt;br&gt;
The model calculates the coefficients with which they can predict the price of a new house if you have the rest of the information available.&lt;br&gt;
There is a linear line that governs the relationships between the size and the price&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;b) Cluster Analysis&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This Exploratory Data Science technique is applied when the observations in the data form groups according to the same criteria&lt;br&gt;
It takes into account that some observations show similarities and facilitate the discovery f new  significant predictors, ones that were not part of the original conceptualization of the data &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;c) Factor Analyses&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If the cluster analysis is about grouping observations together this analysis is about grouping features together.&lt;br&gt;
Data Scientists resort to using it to reduce the dimensionality of a problem. &lt;br&gt;
For example, if you have a questionnaire of 60 questions and every 10 questions are trying to determine a single general attitude. This analysis will identify the 10 factors.&lt;/p&gt;

&lt;p&gt;Once a factor analysis identifies some factors they can be used for a regression that will deliver a more interpretable prediction. A lot of other Data Science techniques are integrated like this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;d) The Time Series Analysis&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is a popular method for following the development of specific values over time.&lt;br&gt;
It is widely used in economics and finance because their subject matter is stock prices and sales volume which are variables that are typically plotted against time &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;e) Logistic Regression&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Since not all relationships between variables can be expressed as linear. Data Science makes use of methods such as logistic regression to create non-linear models. &lt;br&gt;
Logistic Regression Operate with 0’s and 1’s.&lt;br&gt;
For Instance, think about the process of hiring new staff. Companies apply logistic regression algorithms to filter job candidates during the screening process.&lt;br&gt;
If the algorithm estimates that the probability a prospective candidate will perform well in the company within the year is above 50% it will return 1  or a successful application. Otherwise will return 0 and the candidate won't be called in for the interview.&lt;/p&gt;

&lt;p&gt;The above is at the core of the traditional methods for predictive analytics in Data Science.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Machine Learning
&lt;/h3&gt;

&lt;p&gt;Machine learning, compared to Traditional methods of predictive analytics, is far much equipped to handle big data.&lt;br&gt;
As you can imagine machine learning steps on the shoulders of classical statistical forecasting.&lt;br&gt;
People in the data science industry refer to some of these methods as machine learning too but when I talk about machine learning I am referring to newer smatter better methods like Deep Learning.&lt;br&gt;
Don't worry I am still going to tackle this subject and will explain everything clearly. &lt;/p&gt;

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

&lt;p&gt;Thank you very much for taking time to go through this article.&lt;br&gt;
Will be publishing even more content around Machine Learning, be sure to come around.&lt;br&gt;
Please feel free to drop your comments in the comment section.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Mastering Python the Right Way</title>
      <dc:creator>Brayan Kai</dc:creator>
      <pubDate>Wed, 02 Mar 2022 18:08:04 +0000</pubDate>
      <link>https://forem.com/brayan_kai/mastering-python-the-right-way-2gi</link>
      <guid>https://forem.com/brayan_kai/mastering-python-the-right-way-2gi</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;So, what exactly is it? Why is it so well-known that everyone seems to be talking about it? What was the source of it? What is the best way to learn Python? Why should I bother learning it at all?&lt;/p&gt;

&lt;p&gt;Before we started programming, we all had those questions, which is why I chose to write this post to assist you get started with Python the right way. Study like a pro and learn what to do next after you've finished.&lt;/p&gt;

&lt;p&gt;As a beginner, you should be able to start into studying Python after reading this article and make the most out of your learning. As an expert, you should be able to delve deeper into the language and enhance production thanks to the newfound vigor.&lt;/p&gt;

&lt;p&gt;So let's get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Python
&lt;/h2&gt;

&lt;p&gt;Because this is the topic at hand, we must first get to know what Python is.&lt;/p&gt;

&lt;p&gt;In simple words, python is like a fork that is used to eat, yet the same name can also be applied to a fork that is used in cooking and even in kitchen gardening. Everyone holds a fork differently while eating, although it accomplishes the same duty, and people eat different foods with the same equipment, the fork.&lt;/p&gt;

&lt;p&gt;Python is as well a tool that we utilize to address various difficulties.&lt;br&gt;
By creating a website to advertise their items, one can utilize Python to tackle the problem of a lack of clients in their business.&lt;br&gt;
Another option is to utilize Python to construct a data analysis program to handle the problem of unpredictability in taxi scheduling in a city.&lt;/p&gt;

&lt;p&gt;Python can also be utilized in a variety of settings. Whether you're using Mac OS, Linux, or Windows, we've got you covered. That is only a sliver of Python's true potential.&lt;/p&gt;

&lt;p&gt;So we can declare that Python is the fastest-growing programming language in the world, not just for software engineers, but also for mathematicians, linguists, data analysts, network engineers, accountants, and even children.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Python
&lt;/h2&gt;

&lt;p&gt;It's daunting to see how quickly everyone is talking about Python, and it should be.&lt;/p&gt;

&lt;p&gt;Guido van Rossum, Python's founder, had a clear aim for the language: &lt;strong&gt;&lt;em&gt;"make it as simple to grasp as plain English."&lt;/em&gt;&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;In retrospect, this may have been a bit overconfident. Python, on the other hand, strives to emphasize readability and the usage of large white spaces.&lt;br&gt;
To put it another way, it aims to be as near to human language as feasible.&lt;br&gt;
Python's dynamic type nature makes it easy to understand even for those without a technical background, so it's no surprise that it didn't take long for people to fall in love with it.&lt;/p&gt;

&lt;p&gt;Python can handle complicated problems in less time and with fewer lines of code than other programming languages. Let's say you wish to print the first two letters of the word "Lux Academy."&lt;/p&gt;

&lt;p&gt;In &lt;code&gt;C#&lt;/code&gt; &lt;code&gt;str.Substring(0, 3)&lt;/code&gt;&lt;br&gt;
In &lt;code&gt;JavaScript&lt;/code&gt; &lt;code&gt;str.substr(0, 3)&lt;/code&gt;&lt;br&gt;
In &lt;code&gt;Python&lt;/code&gt; &lt;code&gt;str[0:3]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;See how concise and clear the language is? That's only the beginning, Python simplifies a lot of trivial tasks with its basic yet strong syntax.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Python is a high-level language, so unlike other languages like C#, you don't have to worry about things like memory management.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Python is a cross-platform programming language that can be built and run on Windows, Mac OS, and Linux.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Python has a sizable user base. There is always someone willing to assist you whenever you wish to begin studying. I've only shared a few, including &lt;a href="https://twitter.com/lux_academy"&gt;@lux academy&lt;/a&gt;, &lt;a href="https://twitter.com/DSEAfrica"&gt;@DSEAfrica&lt;/a&gt;, and &lt;a href="https://twitter.com/andela_alc"&gt;@andela alc&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Python has a broad library, framework, and tool ecosystem. So whatever you want to do, someone has already done it, and even more are waiting to assist you. It's been around for over 20 years, so you can imagine the wealth of information available.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Consider learning python in the same manner you would learn a spoken language: there is always more to learn and no end in sight. However, if you continue to practice, you will eventually recognize that you have attained your aim.&lt;/p&gt;

&lt;p&gt;So, let's dive in and explore how to learn Python the best way possible. What you can do to learn to grasp and comprehend what you're feeding your brain.&lt;br&gt;
That you can use Python to envision a solution to even the most basic difficulty you encounter in your daily life.&lt;/p&gt;

&lt;h1&gt;
  
  
  Getting started with Python the proper way.
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;Psychology says, train yourself to stop waiting for the "right time".&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What are the prerequisites for learning Python?
&lt;/h2&gt;

&lt;p&gt;Accepting the challenge and wearing &lt;a href="https://youtu.be/H14bBuluwB8"&gt;tenacity&lt;/a&gt; with a growth mentality are required to learn Python.&lt;/p&gt;

&lt;p&gt;You must be willing to learn new things. That is exactly what you require. &lt;br&gt;
As I write this post to you, I do not have access to a computer of my own. But it's never stopped me from learning, writing and coding.&lt;/p&gt;

&lt;p&gt;That public computer at school could help you become the person you've always wanted to be.&lt;br&gt;
Your auntie's PC could be the source of the next-generation AI expert.&lt;/p&gt;

&lt;p&gt;Here are my own recommendations for getting started and getting the most out of your learning experience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Begin right now!&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Find out what makes you want to learn Python.
&lt;/h2&gt;

&lt;p&gt;Learning Python is not easy, and if you don't have a driving force to keep you pedaling toward your ultimate objective, it'll be easy to give up.&lt;br&gt;
Have something that inspires you to continue learning Python.&lt;br&gt;
For example, make that reason particular and project-based.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;"I want to learn Python and design a model that can save young African girls from fistula through early identification and treatment."&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Python can be used for a variety of tasks, including data science, game development, web development, and CAD, to name a few. All of these necessitate distinct resources. As a result, knowing what you want to accomplish with Python makes your job much easier.&lt;/p&gt;

&lt;p&gt;Set a clear and S.M.A.R.T. goal for yourself. &lt;br&gt;
Narrow down what you won't learn, so you may work in little increments, checking off your accomplishment boxes and enjoying your modest victories with each step climbed.&lt;/p&gt;

&lt;p&gt;It is never a good idea to set money as a goal.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Set goals and chase them with passion ..if only you want it you can get it ..just don’t make money your only goal in life ..you will lose your soul and stop living life. Understand money is only a tool and not your score in life you can get happiness from following your passion&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As you develop the python code, keep a passionate aim in mind. Make an effort to make a difference in someone's life.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The human is more important than the technology. Make things more human"  -  Steve Wozniak&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  2. Learn how to use Python's basic syntax.
&lt;/h2&gt;

&lt;p&gt;Start learning basic python syntax with the energy burning within you to achieve your well-stated goal. The goal is to learn as much as possible in as little time as feasible.&lt;br&gt;
You don't have to learn everything or become a python syntax aficionado; all you need to know is enough to go on to the next phase.&lt;/p&gt;

&lt;p&gt;Your aim should be to get through the fundamentals as quickly as possible and then move on to projects.&lt;br&gt;
Make sure you learn by doing, and that you put what you've learned into practice. If you prefer to learn from a textbook or a video, my advice is to attempt to practice as you learn rather than just ingesting what you learn.&lt;/p&gt;

&lt;p&gt;Regardless of where you are learning, strive to experiment with concepts and venture outside of your classroom. Have an inquisitive mindset.&lt;br&gt;
Remember to concentrate on learning and practicing the syntax rather than taking copious notes.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Begin constructing well-structured projects.
&lt;/h2&gt;

&lt;p&gt;Python is now second nature to you. Begin focusing on structured projects that are aligned with your goals. Working on projects is a lot of fun and beneficial.&lt;br&gt;
They'll assist you in gaining real-world experience as you put what you've studied into practice. By taking on new challenges, one can even learn new things.&lt;/p&gt;

&lt;p&gt;Choose a project with a tutorial to work on and get started. Choose something intriguing to work on that will keep you motivated.&lt;/p&gt;

&lt;p&gt;If you want to study python for data science, for example, once you've mastered the basics, look for a course or a data set that interests you, or grab your own data and start working with it.&lt;/p&gt;

&lt;p&gt;This procedure can be difficult and discouraging at times, but if you enjoy what you're doing, you'll be lot more inclined to stick with it&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Start working on your project right away.
&lt;/h2&gt;

&lt;p&gt;Break away from the structure of a tutorial in this phase and start working on your project. This will be a challenge, but one that will force you to learn. &lt;br&gt;
If your project idea appears to be too difficult, consider breaking it down into smaller chunks. Take a step-by-step approach to it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Let's imagine you're a campus student who has a hard time deciding what food to prepare for yourself. So you decide to work on a project that will evaluate your favorite foods and recommend what to cook for yourself, provided that all of the items needed to produce the dish are in your refrigerator and the meal is a well-balanced meal.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So you might start by making a dictionary to keep track of all the ingredients you have in your fridge. Then develop it to the point where it can predict what you want to eat based on your behavior with food before and your taste, then declare the meal and supply a healthy recipe for you.&lt;/p&gt;

&lt;p&gt;Remember that using Google is not a sign of failure. You've learned something new every time you've run into a challenge and had to hunt for a solution.&lt;br&gt;
The dirty little secret about programming is that everyone searches for answers on Google all of the time.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. As you gain experience, make your project more complex.
&lt;/h2&gt;

&lt;p&gt;When you're able to complete your project, you'll be more motivated to go even further.&lt;br&gt;
To keep improving, you must increase the challenge of your projects. This can be accomplished by creating a new project or adding complexity to an existing one.&lt;/p&gt;

&lt;p&gt;Another excellent method is to attempt to write a tutorial for the project you are currently working on. Teaching others why and how your project works can be a very effective learning approach. This, though, can be difficult, yet we are made of more.&lt;/p&gt;

&lt;h3&gt;
  
  
  In a simple question format, here are some recommendations on how to scale up your project and approach this stage:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Is it possible to make your code more efficient or faster?&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, in the code for my Meal Selector project, I can choose to utilize tuples instead of lists as much as possible. In a programming, tuples are more efficient.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Can you make it more accessible to a wider audience?&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Can I, for example, make my meal selector project understand my family's eating habits at home? As a result, it will be able to choose a meal that everyone in the family will enjoys.&lt;br&gt;
Can it choose different meals for family members with varying nutritional needs, such as a breastfeeding mother, a baby in the weaning period, or a sick family member? While not meddling with the other family members' choices.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Can you transform it into a product by making it production-ready?&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Can I, for example, commercialize my Meal Selector Project so that it can learn diverse eating patterns of office workers and select a noon meal for everyone? And you'll get compensated for it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Is it possible to make it more self-contained by removing some of the external dependencies?&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Is it possible for you to design your own project module? That way, you'll be able to cater to your code's unique requirements, removing some of the dependencies.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I believe you can become a solution to a problem in your society by following the above-personalized guide and being honest with yourself. &lt;br&gt;
A Pythonista with a legacy that will be passed down through the generations.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Here are some resources to help you learn Python.
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Websites&lt;/strong&gt;&lt;br&gt;
Free Code Camp&lt;br&gt;
Udemy&lt;br&gt;
Real Python&lt;br&gt;
Code Academy&lt;br&gt;
Skill Share&lt;br&gt;
Coursera&lt;br&gt;
Learn Python&lt;br&gt;
Data Camp&lt;/p&gt;

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

&lt;p&gt;I appreciate you 🤗 taking the time to read this post, and I hope you learned a lot from it and were influenced to greater heights as a result.&lt;br&gt;
I'd appreciate it if you could leave a comment below.😘&lt;/p&gt;

&lt;p&gt;You can contact me via &lt;a href="https://twitter.com/Kai_mwanyumba"&gt;Twitter&lt;/a&gt;, and I'll be happy to respond.&lt;/p&gt;

</description>
      <category>python</category>
      <category>codenewbie</category>
      <category>motivation</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Data Structures 101: Introduction to Data Structures and Algorithms.</title>
      <dc:creator>Brayan Kai</dc:creator>
      <pubDate>Sun, 20 Feb 2022 16:18:31 +0000</pubDate>
      <link>https://forem.com/brayan_kai/introduction-to-data-structures-and-algorithms-with-python-3jhn</link>
      <guid>https://forem.com/brayan_kai/introduction-to-data-structures-and-algorithms-with-python-3jhn</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Data is something that everyone is familiar with, but knowing how to organize, alter, manage, and retrieve data is even more crucial. Being a competent programmer isn't only about whether or not your code works; it's also about readability and scalability, which refers to how fast and memory-efficient your code is.&lt;/p&gt;

&lt;p&gt;A thorough understanding of Data Structures and Algorithms will help you become a better programmer since you will be more concerned with developing good code that is legible by all and highly optimized in terms of time and space (memory).&lt;br&gt;
This article, I believe, will teach you a lot.🎉&lt;/p&gt;
&lt;h3&gt;
  
  
  Prerequisite
&lt;/h3&gt;

&lt;p&gt;To get the most out of this series, you should be familiar with the fundamentals of at least one programming language, preferably Python, because the course will focus on Python Data Structures and Algorithms.&lt;/p&gt;

&lt;p&gt;Another requirement for learning and exploring Data Structures and Algorithms is an open heart.&lt;/p&gt;

&lt;p&gt;Being willing to learn and believing in your ability to succeed. You don't have to put any pressure on yourself, but I believe that if you put forth consistent effort day after day, you will gain the most out of this article.&lt;/p&gt;
&lt;h3&gt;
  
  
  The goal of this article🎉
&lt;/h3&gt;

&lt;p&gt;After reading this article to the end, every reader should be able to :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Understand what Data Structures is,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The different types of data structures, and&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The reasons for studying Data Structures.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  What are Data Structures🤔
&lt;/h2&gt;
&lt;h3&gt;
  
  
  In Simpler Terms
&lt;/h3&gt;

&lt;p&gt;Let me begin by simplifying the entire concept of data structures and algorithms.&lt;/p&gt;

&lt;p&gt;An algorithm is simply a fancy phrase for a software that solves a problem or a set of instructions for solving a problem.&lt;br&gt;
Algorithms may appear to be a bit like a magic act at first glance. You can see the trick's input and output, but everything that happens in between appears to be a bit magical.&lt;br&gt;
My goal is to walk you through the phases of the trick and explain what materials you'll need to pull it off.&lt;br&gt;
The resources are now what we term &lt;strong&gt;data structures&lt;/strong&gt; or a common pattern in the problem in this illustration.&lt;/p&gt;

&lt;p&gt;However, I cannot guarantee that I will go over every last detail, but I believe that after this, you will be able to apply algorithms to problems you may encounter as a developer.&lt;/p&gt;
&lt;h3&gt;
  
  
  Let's take a closer look at Python Data Structures
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Data Structures&lt;/strong&gt; are data storage and organization approaches that make it easier to alter, navigate, and access data. They also decide how data is collected, what functions we may use to access it, and how data is related to one another.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;primary purpose&lt;/em&gt; of data structures is to provide a method for organizing data so that it may be used effectively. There are also several data structures suitable for various applications, some of which are highly specialized for certain purposes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Python algorithms&lt;/strong&gt; are a thorough series of instructions that aid in the data processing for a certain purpose.&lt;/p&gt;

&lt;p&gt;Let's look at the different forms of data structures now.&lt;/p&gt;
&lt;h2&gt;
  
  
  Different Types of Data Structures
&lt;/h2&gt;

&lt;p&gt;There are two types of data structures: primitive and non-primitive, with linear and non-linear data structures falling within the non-primitive category.&lt;/p&gt;
&lt;h3&gt;
  
  
  Linear Data Structures
&lt;/h3&gt;

&lt;p&gt;A linear data structure is one in which data items are ordered consecutively or linearly, with each member attached to its previous and next neighboring elements.&lt;br&gt;
A single level is involved in a linear data structure. As a result, we can explore all of the elements in only one run. Because computer memory is organized in a linear fashion, linear data structures are simple to build. Lists, Linked Lists, Stacks, and Queues are some examples.&lt;/p&gt;
&lt;h3&gt;
  
  
  Non-Linear Data Structures
&lt;/h3&gt;

&lt;p&gt;Non-linear data structures are data structures in which data elements are not ordered sequentially or linearly. A single level is not involved in a non-linear data structure. As a result, we won't be able to traverse all of the elements in a single run. In comparison to linear data structures, non-linear data structures are more difficult to construct. In comparison to a linear data structure, it makes better use of computer memory. Trees and graphs are two examples.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx62h6trpnnok6762ojlq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx62h6trpnnok6762ojlq.png" alt="A chart showing  th types of Data Structures we have"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Types of Data Structures and Their Meanings
&lt;/h2&gt;

&lt;p&gt;We saw that there are linear and non-linear data structures in the previous section, so in this section we'll pick several data structures and see what they signify and how to work with.&lt;br&gt;
We are also going to discuss about Sets, Tuples and Dictionaries in Python I believe they will also be of great interest to us.&lt;/p&gt;
&lt;h3&gt;
  
  
  Lists
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;List&lt;/strong&gt; is, in my opinion, the most popular and simple Data Structure, as well as the most commonly used Data Structure. A list is a data structure that stores data in memory for subsequent use. Each list contains a predetermined number of cells, and each cell has a matching numeric index that is used to access data. You only need the required index to retrieve any of the data in the list whenever you want to use it.&lt;/p&gt;

&lt;p&gt;Multiple items can be stored in a single variable using lists. Square brackets [] are used to make a list, with commas separating elements. Lists can contain items of a single item type in most cases, but they can also contain things of several different types. To represent 2D and 3D grids like matrices, lists can be nested with other lists.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyo3rxdhoggzvrnqtl61b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyo3rxdhoggzvrnqtl61b.png" alt="Example of a list"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Linked Lists
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Linked lists&lt;/strong&gt; are a type of data structure that does not rely on physical data placement in memory. Connected lists employ a reference mechanism instead of indexes or positions: elements are stored in nodes that carry a pointer to the next node, and so on until all nodes are linked.&lt;/p&gt;

&lt;p&gt;This approach enables for quick item placement and removal without the need for reorganization.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb003ftydlyad75f0ddke.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb003ftydlyad75f0ddke.png" alt="Linked Lists"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Sets
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;A set&lt;/strong&gt; is a group of elements that are not in any particular sequence. Every set element must be one-of-a-kind and unchangeable. Curly braces or the set function set() are used to make them. They share several features with lists, such as the ability to use in to see if they contain a specific item.&lt;/p&gt;

&lt;p&gt;You must use set() to construct an empty set, as set{} creates an empty dictionary.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# empty set
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;my_set&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Dictionaries
&lt;/h3&gt;

&lt;p&gt;Dictionaries are a collection of items that are not in any particular sequence. They're data structures that let you map any key to any value. When the key is known, dictionaries are optimized to retrieve values.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# empty dictionary
&lt;/span&gt;&lt;span class="n"&gt;emoty_dict&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

&lt;span class="c1"&gt;# dictionary with integer keys
&lt;/span&gt;&lt;span class="n"&gt;num_dict&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Vitalis&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Kandie&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;.get()&lt;/code&gt; is a helpful dictionary technique. It works in the same way as indexing, except if the key isn't found in the dictionary, it returns another value (by default, 'None').&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;bird&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;screech&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;color&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;blue&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Name: &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;person&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;color: &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bird&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;color&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="c1"&gt;# value is not provided
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;origin: &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bird&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;origin&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; 

&lt;span class="c1"&gt;# value is provided
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;origin: &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bird&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;origin&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;United Kingdom&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Tuples
&lt;/h3&gt;

&lt;p&gt;Tuples are comparable to lists with the exception that they are immutable (they cannot be changed). They're made with parentheses (). We utilize indexing, much as in lists, to retrieve the values in the tuple. A &lt;a href="https://www.programiz.com/python-programming/exceptions" rel="noopener noreferrer"&gt;TypeError&lt;/a&gt; occurs when a value in a tuple is reassigned. Tuples are quicker than lists, but they can't be modified.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Empty tuple
&lt;/span&gt;&lt;span class="n"&gt;empty_tuple&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;empty_tuple&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Tuple having integers
&lt;/span&gt;&lt;span class="n"&gt;num_tuple&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num_tuple&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# tuple with mixed datatypes
&lt;/span&gt;&lt;span class="n"&gt;mix_tuple&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hiya&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;5.4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mix_tuple&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# nested tuple
&lt;/span&gt;&lt;span class="n"&gt;nest_tuple&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;here&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nest_tuple&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;#indexing
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nest_tuple&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="c1"&gt;#here
&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Stack
&lt;/h3&gt;

&lt;p&gt;A stack is a linear data structure in which operations are carried out in a specific order. The sequence could be LIFO (Last In First Out) or FILO (First In Last Out) (First In Last Out).&lt;/p&gt;

&lt;p&gt;There are numerous examples of stacks in the real world. Consider the canteen, where plates are heaped on top of one another. The plate at the top is the first to be removed, but the plate at the bottom is the one that stays in the stack the longest. As a result, it is easy to observe that it follows the LIFO (Last In First Out)/FILO (First In Last Out) order.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnyrhvov3ejgg2nrfw4pc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnyrhvov3ejgg2nrfw4pc.png" alt="Stack Explanation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To implement stack as seen in the illustration above we need two simple operations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;push : It adds an element to the top of the stack.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;pop: It takes an element from the top of the stack and removes it.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Operations:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Adding - This raises the size of the stack by adding items to it. The addition occurs at the very top of the stack.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deletion consists of two conditions: first, if no element is present in the stack, the stack will underflow; second, if the stack contains items, the topmost element will be removed. It reduces the size of the stack.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Traversing entails going through each piece of the stack.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Queues
&lt;/h3&gt;

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

&lt;p&gt;As a result, queues are similar to FIFO (First In, First Out) versions of stacks. These serve as a request buffer, keeping requests in the order they were received until they can be processed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmq92vrs7jugiy8kx4eck.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmq92vrs7jugiy8kx4eck.png" alt="Queues In Python"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Trees
&lt;/h3&gt;

&lt;p&gt;Trees are another type of relation-based data structure that is used to depict hierarchical hierarchies. Nodes, like linked lists, contain both data and pointers indicating their relationship to other nodes.&lt;/p&gt;

&lt;p&gt;Every tree has a "root" node that all other nodes branch off of. All items right below it, referred to as "child nodes," are referenced from the root. This process repeats itself, with each child node branching out into further child nodes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvfhsskwiouujvvhml0a2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvfhsskwiouujvvhml0a2.png" alt="Trees illustration"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Graphs
&lt;/h3&gt;

&lt;p&gt;Graphs are a type of relational data structure that can be used to store web-like relationships. In graphs, each node, or vertex, has a title, a value, and a list of links (called edges) it has with other vertices.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffq0rf2su8ny3bwl7e1g8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffq0rf2su8ny3bwl7e1g8.png" alt="Graph illustration"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe6opkcxt9sziqmxvlt02.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe6opkcxt9sziqmxvlt02.png" alt="Graph Description 2"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Various Operations that can be performed on Data Structures:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Insertion:&lt;/strong&gt; Add a new data item to the specified data item collection.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Delete:&lt;/strong&gt; Removes an existing data item from a collection of data items.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Traversal:&lt;/strong&gt; Only access each data item once in order to process it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Searching:&lt;/strong&gt; If the data item exists in the given collection of data items, find its location.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Sorting&lt;/strong&gt; entails arranging data items in a specific order, such as ascending or descending for numerical data and dictionary order for alphanumeric data.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What are the Benefits of Data Structures?
&lt;/h2&gt;

&lt;p&gt;You must understand Data Structures and how to execute various operations on them if you want to become a skilled programmer who creates good code😊.&lt;/p&gt;

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

&lt;p&gt;Wow😍, I bet you gained a lot of knowledge from this article. In this fantastic series of Getting Started with Data Structures and Algorithms, keep an eye out for more from my blog. &lt;br&gt;
You can also read this &lt;a href="https://dev.to/brayan_kai/python-101-introduction-to-modern-python-2757"&gt;article&lt;/a&gt; to learn more about dictionaries, sets, tuples, and lists.&lt;br&gt;
You can reach out to me on &lt;a href="//mobile.twitter.com/Kai_mwanyumba"&gt;Twitter&lt;/a&gt; to learn more about any subject, and I will respond. Thank you for taking the time to read this😘.&lt;/p&gt;

&lt;p&gt;Enjoy🎉&lt;/p&gt;

</description>
      <category>python</category>
      <category>tutorial</category>
      <category>datastructures</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>Python 101: Introduction to Modern Python</title>
      <dc:creator>Brayan Kai</dc:creator>
      <pubDate>Sun, 13 Feb 2022 14:47:36 +0000</pubDate>
      <link>https://forem.com/brayan_kai/python-101-introduction-to-modern-python-2757</link>
      <guid>https://forem.com/brayan_kai/python-101-introduction-to-modern-python-2757</guid>
      <description>&lt;p&gt;&lt;strong&gt;Python&lt;/strong&gt; is one of the most widely used programming languages. Guido van Rossum created it, and it was released in 1991. It's used for server-side web development, software development, mathematics, and system programming just to mention.&lt;/p&gt;

&lt;p&gt;Some of the most noticeable differences between Python and other programming languages are that Python uses new lines to complete commands, rather than semicolons or parentheses &lt;em&gt;(though the semicolons(;) are optional and usually not used in python)&lt;/em&gt;, and that Python relies on indentation, using whitespace, to define scope; for example, the scope of loops, functions, and classes. Curly brackets are commonly used in other computer languages for this purpose.&lt;/p&gt;

&lt;p&gt;Python is well-known for its general-purpose character, which makes it suitable for and the finest solution provider in practically any software development domain. Python is used in a variety of developing fields, including Data Science and Big Data Analytics. It is the most popular programming language and may be used to create any application.&lt;/p&gt;

&lt;p&gt;A Python script which is essentially a file that contains a python code should have an extension &lt;strong&gt;.py&lt;/strong&gt; and can be run from the command line by typing python &lt;strong&gt;file_name.py&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Features of python&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Python is a free and open source programming language that can be downloaded from the official website, with even its source code available.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Python is a portable programming language its code can be shared and will continue to function as intended. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Python is an expressive language, which implies it is more intelligible and readable than other programming languages.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Python is a simple language to pick up and use, just focusing more on the code rather than the language's syntax.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Python features a huge and diverse library, as well as a comprehensive set of modules and functions enabling rapid application development.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Platform Independent, write once and run anywhere&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Its Dynamically typed giving the programmer additional flexibility.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Object-Oriented, python supports object oriented language and concepts of classes and objects come into existence.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Applications of python
&lt;/h2&gt;

&lt;p&gt;Python is utilized in a wide range of applications. Here's a small sample:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Web and internet development&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Education&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scientific and numeric&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Business Applications&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;3D CAD Applications&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Image processing Applications&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Artificial Intelligence&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Python installation
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.python.org/downloads/"&gt;Here's&lt;/a&gt; where you can get the most recent version of Python for your operating system. &lt;br&gt;
This &lt;a href="https://www.pythontutorial.net/getting-started/setup-visual-studio-code-for-python/"&gt;pythontutorial.net&lt;/a&gt; tutorial will teach you how to set up a Python development environment using VS Code.&lt;br&gt;
You can use IDEs like &lt;a href="https://www.jetbrains.com/pycharm/"&gt;PyCharm&lt;/a&gt; or any &lt;a href="https://www.programiz.com/python-programming/ide"&gt;other&lt;/a&gt; after installing Python.&lt;br&gt;
&lt;strong&gt;Note&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Python 3.10 will include a lot of cool new features, but it's currently in beta. Installing it as your default Python version may not be a good choice because it isn't production-ready.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  First Python Program
&lt;/h2&gt;

&lt;p&gt;Lets go ahead and create our first python program to display "Hello World!" .&lt;/p&gt;

&lt;p&gt;To begin, make a new folder called lets say , python , in which you will save your Python files.&lt;/p&gt;

&lt;p&gt;Second, start Visual Studio Code and go to the new folder you made, python.&lt;/p&gt;

&lt;p&gt;Third, create a new python file, say first.py, and paste the following code into it before saving it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello World!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A built-in function, print() which we have used above, shows a message on the screen. It will display the message 'Hello Word!' in our case.&lt;/p&gt;

&lt;h3&gt;
  
  
  Executing Our First Python Program
&lt;/h3&gt;

&lt;p&gt;To run the first.py file we generated earlier, use the Command Prompt on Windows or the Terminal on Mac or Linux.&lt;/p&gt;

&lt;p&gt;Then, for our case,  navigate to the folder, python , holding our file. Learn more on terminal commands &lt;a href="https://amigoscode.com/courses/enrolled/855076"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then, to run the app.py file, type the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;Python3&lt;/span&gt; &lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;py&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The following output will be displayed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;Hello&lt;/span&gt; &lt;span class="n"&gt;World&lt;/span&gt;&lt;span class="err"&gt;!&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Comments
&lt;/h2&gt;

&lt;p&gt;When writing a program, comments are crucial. It explains what happens inside a program so that someone looking at your source code doesn't have trouble deducing what's going on.&lt;/p&gt;

&lt;p&gt;To begin creating a comment in python we utilize the hash symbol (#) &lt;br&gt;
If we have comments that span multiple lines, &lt;em&gt;multi-line comments&lt;/em&gt; we can use the hash symbol at the start of each line . Another option is to use triple quotes such as ''' or """&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# This is a single line comment
&lt;/span&gt;
&lt;span class="s"&gt;'''
multiline comment
This comment is written in more than one line
'''&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;Variables are names that are connected to a specific object in Python. They keep a reference to the memory address where an item is stored, often known as a pointer.&lt;br&gt;
The syntax is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;variable_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;variable_value&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Always name your variables in a way that is both intuitive and readable.&lt;br&gt;
Uppercase and lowercase letters (A-Z, a-z), numerals (0-9), and the underscore character (_) can all be used in variable names.&lt;br&gt;
Variable names may contain digits, but the initial character must not be a numeric.&lt;/p&gt;

&lt;p&gt;Variables do not require declaration. Python is a dynamically typed language since their data types are deduced from their assignment statement. This means that throughout the code, different data types might be given to the same variable.&lt;/p&gt;

&lt;p&gt;Below are examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;first_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Haddasah"&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;first_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Chenda"&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;first_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;last_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Maghanga"&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;last_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Arithmetic operators
&lt;/h2&gt;

&lt;p&gt;Addition, subtraction, multiplication, division, and other operations are represented by arithmetic operators. They produce expressions that Python can evaluate when combined with numbers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 12 (addition)
&lt;/span&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 0 (subtraction)
&lt;/span&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 25 (multiplication)
&lt;/span&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;22&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 11.0 (division)
&lt;/span&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 125 (exponent)
&lt;/span&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 1 (remainder of the division)
&lt;/span&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 1 (floor division)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Logical Conditional &amp;amp; Comparison Operators
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Comparison Operators
&lt;/h3&gt;

&lt;p&gt;Comparison_(Relational)_ Operators compare the values. It either returns True or False according to the&lt;br&gt;
condition. They are as listed below: &lt;strong&gt;&amp;gt;&lt;/strong&gt; (greater than), &lt;strong&gt;&amp;gt;=&lt;/strong&gt; (greater than or equal to), &lt;strong&gt;&amp;lt;&lt;/strong&gt; (less than), &lt;strong&gt;&amp;lt;=&lt;/strong&gt; (less than or equal to), &lt;strong&gt;==&lt;/strong&gt;&lt;br&gt;
(equal to), &lt;strong&gt;!=&lt;/strong&gt; (not equal)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"a &amp;gt; b is "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"a &amp;gt;= b is "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;=&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"a &amp;lt; b is "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"a &amp;lt;= b is "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;=&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"a == b is "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"a != b is "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;!=&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;#Output
&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Chaining of relational operators is possible. In the chaining, if all comparisons returns True then only result is True. If at least one comparison returns False then the result is False
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="o"&gt;==&amp;gt;&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;
&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt; &lt;span class="o"&gt;==&amp;gt;&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;
&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;40&lt;/span&gt; &lt;span class="o"&gt;==&amp;gt;&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;
&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt; &lt;span class="o"&gt;==&amp;gt;&lt;/span&gt;&lt;span class="bp"&gt;False&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Logical Operators
&lt;/h3&gt;

&lt;p&gt;They allow a program to make a decision based on multiple conditions. Each operand is&lt;br&gt;
considered a condition that can be evaluated to a true or false value. They are:&lt;/p&gt;

&lt;p&gt;and, or, not&lt;/p&gt;
&lt;h4&gt;
  
  
  For boolean types behavior:
&lt;/h4&gt;

&lt;p&gt;➢ and ==&amp;gt;If both arguments are True then only result is True&lt;br&gt;
➢ or ==&amp;gt;If atleast one arugemnt is True then result is True&lt;br&gt;
➢ not ==&amp;gt;complement&lt;/p&gt;
&lt;h4&gt;
  
  
  For non boolean type’s behavior
&lt;/h4&gt;

&lt;p&gt;➢ 0 means False&lt;br&gt;
➢ non-zero means True&lt;br&gt;
➢ empty string is always treated as False&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;
&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"a and b is "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"a or b is "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"not b is "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"c and b is "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"c and b is "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"not c is"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Output
&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;
&lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;h3&gt;
  
  
  if
&lt;/h3&gt;

&lt;p&gt;Decision making is required when we want to execute a code only if a certain condition is satisfied&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s"&gt;"is a positive   number."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"This is always printed."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Output
&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;positive&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="n"&gt;This&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="n"&gt;always&lt;/span&gt; &lt;span class="n"&gt;printed&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  else
&lt;/h3&gt;

&lt;p&gt;The if-else statement evaluates test expression and will execute body of if only when test condition is True.&lt;br&gt;
If the condition is False, body of else is executed. Indentation is used to separate the blocks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;
&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;33&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"b is greater than a"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"b is not greater than a"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Output
&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;greater&lt;/span&gt; &lt;span class="n"&gt;than&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  elif
&lt;/h3&gt;

&lt;p&gt;The elif is short for else if. It allows us to check for multiple expressions.&lt;br&gt;
Sometimes there are more than two possibilities and we need more than two branches.&lt;br&gt;
One way to express a computation like that is a chained conditional.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"i is 10"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"i is 15"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"i is 20"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"i is not present"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Output
&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Data types
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Strings
&lt;/h3&gt;

&lt;p&gt;Any single characters within either single, double or triple quotes is considered as a string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Use single quotes
&lt;/span&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'Good Morning Kenya!'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="s"&gt;'Good Morning Kenya!'&lt;/span&gt;

&lt;span class="c1"&gt;#Use double quotes
&lt;/span&gt;&lt;span class="n"&gt;community&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Lux Tech Academy"&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;community&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="s"&gt;'Lux Tech Academy'&lt;/span&gt;

&lt;span class="c1"&gt;# Use triple quotes
&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"""Thank you for reading this article"""&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="s"&gt;'Thank you for reading this article'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After you've defined your string objects, you may concatenate them with the plus operator (+):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Lux"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"Academy"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="s"&gt;'Lux Academy'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The string class (str) contains a number of helpful methods for manipulating and processing strings. Below are jyst but a few examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;str.upper()&lt;/strong&gt; returns a copy of the underlying string with all the letters converted to uppercase:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="s"&gt;"Consistency is key"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;upper&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="s"&gt;'CONSISTENCY IS KEY'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;str.join()&lt;/strong&gt; takes an iterable of strings and joins them together in a new string.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="s"&gt;" "&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s"&gt;"Data"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Science"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="s"&gt;'Data Science'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Numbers
&lt;/h3&gt;

&lt;p&gt;Python has three forms of numeric data: int, float, and complex. They don't need to be specified because they're inferred.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Integers:&lt;/strong&gt; Are whole numbers&lt;br&gt;
Examples 5,4,6&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Floats:&lt;/strong&gt; Numbers with decimal points&lt;br&gt;
Examples 3.4,5.6,8.9&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Complex numbers:&lt;/strong&gt; Numbers with a real part and an imaginary part&lt;br&gt;
Examples 1.5j,3+3.5j&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;pi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;3.14&lt;/span&gt; &lt;span class="c1"&gt;#float
&lt;/span&gt;
&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="c1"&gt;#int
&lt;/span&gt;
&lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;389j&lt;/span&gt;&lt;span class="n"&gt;L0&lt;/span&gt; &lt;span class="c1"&gt;#complex number
&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Booleans
&lt;/h3&gt;

&lt;p&gt;In Python, Booleans are represented as an integer subclass with only two possible values: True or False. The first letter of each value must be capitalized.&lt;br&gt;
When utilizing comparison operators, Booleans come in helpful as it was seen above.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# booleans
&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Data Scince EastAfrica"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Lists
&lt;/h3&gt;

&lt;p&gt;A list in Python is what other programming languages call an array. Multiple items can be stored in a single variable using lists.&lt;br&gt;
In Python, lists are created by enclosing a comma-separated list of objects in square brackets ([]), as illustrated below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;favourite_drinks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"water"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"wine"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"juice"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;favourite_drinks&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;water&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;wine&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;juice&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The following are the characteristics of Python lists:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Lists are arranged in a certain sequence.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Any object can be included in a list.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The index can be used to retrieve list elements.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lists can be nested arbitrary deep.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lists can be changed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lists are fluid.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  List Modification Methods
&lt;/h4&gt;

&lt;h5&gt;
  
  
  append(object)
&lt;/h5&gt;

&lt;p&gt;Appends an object to the end of a list.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;winners&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Winnie&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;Grace&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;Muusi&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Ndanu&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;:[&lt;/span&gt;&lt;span class="n"&gt;Winnie&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;Grace&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;Muusi&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;Ndanu&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  extend(iterable)
&lt;/h5&gt;

&lt;p&gt;Adds to the end of a list, but the argument is expected to be an iterable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;'a'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'b'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;'a'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'b'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  insert()
&lt;/h5&gt;

&lt;p&gt;Inserts an object into a list at the specified index.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;'name'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'location'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'address'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s"&gt;'email'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;insert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;'name'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'location'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'address'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'email'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

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

&lt;/div&gt;



&lt;h5&gt;
  
  
  remove()
&lt;/h5&gt;

&lt;p&gt;Removes an object from a list&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;'name'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'location'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'email'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'address'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;remove&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'email'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;'name, '&lt;/span&gt;&lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="s"&gt;', '&lt;/span&gt;&lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="s"&gt;']
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Tuples
&lt;/h3&gt;

&lt;p&gt;Tuples are similar to lists in every way except for the features listed below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Instead of square brackets ([]), tuples are defined by surrounding the elements in parenthesis (()).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tuples are immutable, thus they can't be changed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When manipulating a tuple, execution is faster. A tuple can be illustrated as follows:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;#tuples
&lt;/span&gt;
&lt;span class="n"&gt;new_tuple&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"van"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"car"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"pat"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"darn"&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"run"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new_tuple&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="c1"&gt;# 5
&lt;/span&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new_tuple&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="c1"&gt;# car
&lt;/span&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new_tuple&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="c1"&gt;# ('car', 'pat', 'darn')
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Dictionaries
&lt;/h3&gt;

&lt;p&gt;In Python, a dictionary is an ordered collection that is used to hold data values.&lt;br&gt;
Curly braces ( {} ) can be used to define a dictionary by enclosing a comma-separated list of key-value pairs. Each key is separated from its associated value by a colon (:).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;new_dict&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;"Lux Academy"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Twitter Handle"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;"@lux_academy"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new_dict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s"&gt;"Lux Academy"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thank you very much for taking time to read this. I would really appreciate any comment in the comment section.&lt;/p&gt;

&lt;p&gt;You can connect with me on twitter &lt;a href="//mobile.twitter.com/Kai_mwanyumba"&gt;@Kai_mwanyumba&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>datascience</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Top 6 Features in React</title>
      <dc:creator>Brayan Kai</dc:creator>
      <pubDate>Wed, 09 Feb 2022 14:29:06 +0000</pubDate>
      <link>https://forem.com/brayan_kai/top-6-features-in-react-3b18</link>
      <guid>https://forem.com/brayan_kai/top-6-features-in-react-3b18</guid>
      <description>&lt;h2&gt;
  
  
  What is React
&lt;/h2&gt;

&lt;p&gt;Let us start first by getting to know what React is.&lt;/p&gt;

&lt;p&gt;React is a JavaScript library for creating user interfaces that is declarative, efficient, and customizable.&lt;/p&gt;

&lt;p&gt;Let's take a look at React, its history, and some of its basic concepts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;React&lt;/strong&gt; was conceived at Facebook and, with the exception of a minor snag in 2017 over license restrictions, has seen steady growth since its launch. React may be the most popular JavaScript framework nowadays, depending on whose statistics you look at.&lt;/p&gt;

&lt;p&gt;Here is just but a few reasons why people chose to program with React:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;React is lightning &lt;em&gt;fast&lt;/em&gt;. React apps can handle complicated updates while still feeling fast and responsive.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;React is &lt;em&gt;modular&lt;/em&gt;. You can write several smaller, reusable files instead of massive, dense code files. The modularity of React can be a lovely answer to JavaScript's maintainability issues.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;React is a &lt;em&gt;scalable framework&lt;/em&gt;. React works best in large projects that display a lot of changing data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;React is &lt;em&gt;adaptable&lt;/em&gt;. You can use React for a variety of projects that aren't related to building a web app. React's potential is still being discovered. &lt;a href="https://github.com/jiwonbest/amazing-react-projects"&gt;There's a lot to discover&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;React is a &lt;em&gt;popular framework&lt;/em&gt;. While this rationale has little to do with React's quality, it is true that knowing React will increase your employability.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;Let's now delve in into the features of React:&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;We are going to look into the following top features of react:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;JSX&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Components&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;One-way Data Binding&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Virtual DOM&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Simplicity&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Performance&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So Lets get right into it&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JSX&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;JavaScript XML is abbreviated as JSX. It's a syntax extension for JavaScript. Its an XML or HTML like syntax used by ReactJS. This syntax is converted into React Framework JavaScript calls. It enhances ES6 to allow HTML-like text and JavaScript react code to coexist. It is not required to utilize JSX, however it is strongly recommended in ReactJS.&lt;br&gt;
Because JSX isn't supported by browsers, the &lt;a href="https://www.geeksforgeeks.org/reactjs-using-babel/"&gt;Babel compiler&lt;/a&gt; converts the code to JavaScript.&lt;/p&gt;

&lt;p&gt;JSX is one of the best features of React JS as it makes it super easy for developers to write the building blocks&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Components&lt;/strong&gt;&lt;br&gt;
Components are at the heart of ReactJS. A ReactJS application consists of several components, each with its own logic and controls. These components are reusable, which makes it easier to keep track of the code when working on larger projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One-way Data Binding&lt;/strong&gt;&lt;br&gt;
ReactJS is built to follow unidirectional data flow, often known as one-way data binding. The advantages of one-way data binding provide you more control over the application as a whole. If the data flow occurs in the opposite way, additional characteristics are required. Because components are designed to be immutable, and the data they contain cannot be modified, this is the case. Flux is a pattern that aids in data unidirectionality. As a result, the application becomes more versatile, resulting in increased efficiency.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Virtual DOM&lt;/strong&gt;&lt;br&gt;
The original DOM object is represented by a virtual DOM object. It functions similarly to a one-way data binding. The complete UI is re-rendered in virtual DOM representation whenever any changes are made to the web application. Then it compares the old DOM representation to the new DOM representation. After that, the true DOM will only update the elements that have actually changed. This speeds up the application and eliminates memory waste.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Simplicity&lt;/strong&gt;&lt;br&gt;
ReactJS uses JSX file which makes the application simple and to code as well as understand. We know that ReactJS is a component-based approach which makes the code reusable as your need. This makes it simple to use and learn.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Performance&lt;/strong&gt;&lt;br&gt;
ReactJS is well-known for its performance. This characteristic sets it apart from other frameworks available today. This is due to the fact that it controls a virtual DOM. The Document Object Model (DOM) is a cross-platform computer programming API for dealing with HTML, XML, and XHTML. The DOM is fully memory-based. As a result, we didn't write directly to the DOM while creating a &lt;br&gt;
component. Instead, we'll create virtual components that will be converted into the DOM, resulting in smoother and faster performance.&lt;/p&gt;




&lt;p&gt;This article was just as an intro to react. Tune in the blog for more. The next article will be building up in react from zero to becoming a badass react developer.&lt;/p&gt;

&lt;p&gt;Thank you very much for taking time to read this. I would really appreciate any comment in the comment section.&lt;/p&gt;

&lt;p&gt;You can connect with me on twitter &lt;a href="//mobile.twitter.com/Kai_mwanyumba"&gt;@Kai_mwanyumba&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>node</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>ES6 Basic Features</title>
      <dc:creator>Brayan Kai</dc:creator>
      <pubDate>Thu, 27 Jan 2022 13:12:35 +0000</pubDate>
      <link>https://forem.com/brayan_kai/es6-basic-features-229l</link>
      <guid>https://forem.com/brayan_kai/es6-basic-features-229l</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5pdppihy2wspkph3tv2h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5pdppihy2wspkph3tv2h.png" alt="ES6"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What exactly is ES6?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The ES6 language specification standard, often known as ECMAScript 2015, is the 6th and most recent version of the ECMAScript language specification standard. It is far more popular than the preceding edition, ES5, in terms of defining the standard for JavaScript implementation.&lt;/p&gt;

&lt;p&gt;In this article, we'll go over some of the ES6 features you'll need to know to get started with Modern Javascript. Let's get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding these Features
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Let and Const&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Users can define variables with the term "let," while users can define constants with the keyword "const." Variables were formerly declared with the "var" keyword, which had function scope and was positioned at the top. It means that you can utilize a variable before declaring it. The "let" variables and constants, on the other hand, have block scope and can't be used before declaration because they're surrounded by curly brackets.&lt;/p&gt;

&lt;p&gt;Both let and const are block-scope variables, which means they can only be used within the block in which they are declared.&lt;/p&gt;

&lt;p&gt;Code Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// traditional&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 5&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 8&lt;/span&gt;

&lt;span class="c1"&gt;// es6&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;l&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;17&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;l&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;//4&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Error: Cannot access 'j' before initialization&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;29&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;39&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;k&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Error: Assignment to constant variable.&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;h&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;goodbye&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;h&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// hello&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Error: Missing initializer in const declaration&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Arrow Functions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Arrow functions is a new feature in ES6. The "function" and "return" keywords are removed, resulting in a more compact syntax for creating function expressions.&lt;/p&gt;

&lt;p&gt;Arrow functions are defined using the fat arrow (=&amp;gt;) notation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Arrow function&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;sum&lt;/span&gt; &lt;span class="nx"&gt;Of&lt;/span&gt; &lt;span class="nx"&gt;Two&lt;/span&gt; &lt;span class="nx"&gt;Numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;90&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;// Output 100&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is no "return" or "function" keyword in the arrow function declaration, as can be seen.&lt;/p&gt;

&lt;p&gt;We can also avoid the parenthesis in the scenario where there is exactly one parameter, but will always need to include it when you have zero or more than one parameter.&lt;/p&gt;

&lt;p&gt;However, if the function body contains many expressions, we must surround it in curly brackets ("{}"). To return the required value, we must also utilize the "return" statement.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Template Literals&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Simple string templates and placeholders for variables are introduced in ES6. The string template is used inside the back-ticked string and has the syntax ${PARAMETER}.&lt;/p&gt;

&lt;p&gt;Below is an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;coding&lt;/span&gt; &lt;span class="nx"&gt;community&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`The name of my favorite coding community is &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Multi-Line Strings&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Multi-line Strings are also available in ES6. Back-ticks can be used to produce multi-line strings.&lt;/p&gt;

&lt;p&gt;It can be done in the following way:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;favorite&lt;/span&gt; &lt;span class="nx"&gt;slogans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`Yes We Can,     
                        Together As One,
                        Freedom , Development , Peace`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Default Parameters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ES6 also came with default parameters. If no value is passed or if undefined is passed, it allows you to set default values for your function parameters.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;//&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;calculateSum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;boys&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;girls&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
    &lt;span class="c1"&gt;// logic&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above however, was not the case in ES5, as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;//ES5&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;calculateSum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;boys&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;girls&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
   &lt;span class="nx"&gt;boys&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="nx"&gt;boys&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="mi"&gt;90&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="nx"&gt;girls&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;girls&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="mi"&gt;110&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="c1"&gt;// logic&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Enhanced Object Literals&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Object literals have been improved in ES6 to make it easier to quickly build objects with properties inside the curly braces.&lt;/p&gt;

&lt;p&gt;Below is an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getStudent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;gender&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;course&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nx"&gt;gender&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nx"&gt;course&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nf"&gt;getStudent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Tasha&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Femle&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Computer Science&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Promises&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Asynchronous execution is handled through Promises in ES6. As shown here, promise can be used with the arrow function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;asyncCall&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;reject&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="c1"&gt;// do something&lt;/span&gt;
   &lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;   
   &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;DON!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Destructuring Assignment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the most popular aspects of ES6 is destructuring. The destructuring assignment is an expression that allows you to quickly remove values from arrays or properties from objects and store them in separate variables.&lt;/p&gt;

&lt;p&gt;Array destructuring and Object destructuring are the two types of destructuring assignment expressions. It's possible to use it in the following ways:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;//Array Destructuring&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;birds&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Crested Auklet&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Carribean Dove&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;birds&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Array destructuring assignment&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;//Object Destructuring&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;person&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Prudence&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;person&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Object destructuring assignment&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Modules&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Modules were previously not supported natively in JavaScript. Modules are a new feature introduced in ES6, where each module is represented by a separate ".js" file. We can import or export variables, functions, classes, or any other component from/to different files and modules using the "import" or "export" declaration in a module.&lt;/p&gt;

&lt;p&gt;Below is a code example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fullName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;   
   &lt;span class="c1"&gt;//data&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;getName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;module&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 48&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thank you for taking the time to read this!&lt;/p&gt;

&lt;p&gt;I'd be grateful if you could leave your views and opinions in the comments section.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>es6</category>
      <category>tutorial</category>
      <category>frontend</category>
    </item>
  </channel>
</rss>
