The '!' behind the 0, is notation for something called a 'factorial'.

A factorial basically tells you to take the product of all integers and itself before it until you reach 1.

If that didn't make any sense, take a look at this example.

1! = 12! = 1 x 23! = 1 x 2 x 34! = 1 x 2 x 3 x 4

See what I am talking about?

Now before we go to why 0! = 1, let's take a look at something called exponents and some patterns in them which will help us later on.

π₯ (read as "π₯ to the power of n") basically tells you that π₯ is multiplied by itself 'n' times, like:

2 = 2 x 2 = 42 = 2 x 2 x 2 = 8

Now what do you think 2 will be?

You might think that 2 multiplied by itself 0 times should be 0, but as it turns out any number to the power of 0 = 1.

2 = 1, but how?

That might not make sense on first glance, but let me show you why it is correct.

Here's a list of some of the powers of 2, you'll notice a pattern over here.

Each time you go up one level, you're essentially dividing by 2, what happens when you get to 2?

You get 1, and now it all makes sense.

This is why every number to the power of 0 is 1.

(This also works for powers in negative numbers)

Factorials follow a similar pattern as you can see below, and as you can guess, 0! turns out to be 1 by this pattern!

Factorials aren't just about showing a neat pattern, they have real world use cases in combinatorics, a topic in math that deals with counting.

Let me explain.

You have 2 balls, one yellow and the other is blue.

In how many different ways can you arrange them?

There are 2 possible cases, now similarly can you guess how many ways can you arrange 3 balls?

There are 6 possible cases to arrange 3 balls.

As it turns out, the number of ways you can arrange n balls is n!

2 balls = 2! = 2 3 balls = 3! = 6

2! basically means "in how many ways can arrange 2 balls" which is 2.

Now what 0! tells you is how many ways can you arrange 0 balls, or basically nothing.

There is exactly one way to show nothing!

Which again proves why 0! is 1.

]]>A store owner recently noticed an alarmingly high rate of shoplifting.

He develops a machine learning model that predicts if a customer has shoplifted or not and it is 95% accurate!

He deploys the model but a month later catches no shoplifters...

Why?

Before we get into this problem it is important to understand what accuracy is.

Accuracy is the number of times you predicted something correctly divided by how many times you actually predicted it.

If you closely look at the dataset, you will notice that out of the 10,000 customers that entered the store, only 500 were shoplifters in that month.

Some quick math will tell you that 95% of customers are not shoplifters and the other 5% are.

If you basically said that everyone was not a shoplifter, you'd be correct in 95 out of 100 cases, which is what the model did.

You would be wrong in the other 5 cases, but who cares?

We're still 95% accurate, but this is clearly not what we are looking for.

This problem happens in 'imbalanced' datasets where the data is heavily skewed.

You're either a shoplifter, or you're not, and the former is significantly more present in the dataset.

Our model finds a shortcut to increase accuracy.

Then, how do we solve this problem?

Evaluate your model using a different metric, let us take a look at recall and precision, but first, it is important to understand some terminology.

This is a confusion matrix, it shows you all the possible scenarios of the predictions of a model Vs the ground truth.

Pretty confusing right? (No pun intended)

Let me simplify it.

This meme explains is better, the confusion matrix shows us the predictions of a model Vs the ground truth.

Consider the doctor to be the model and the patient to be the ground truth.

Case 1: Our model predicts someone shoplifted when they actually did (TP - True Positive)

Case 2: Our model predicts someone shoplifted when they didn't (FP - False Positive)

Case 3: Our model predicts someone did not shoplift when they did (FN - False Negative)

Case 4: Our model predicts someone did not shoplift when they didn't (TN - True Negative)

Whenever you're confused, just refer to the above meme ;)

In formal terms, 'recall' is defined using this formula.

- What this metric basically does is tells us how good our model is at identifying relevant samples.

Or

- How good is our model at catching actual shoplifters?

TP: Shoplifters correctly identifiedFN: Shoplifters missed

Now if the model classifies no one as a shoplifter, it is going to have 0 recall.

This means it is "not good at all" if we are optimizing to have as high of recall as possible.

On the flip side, what if we label everyone as a shoplifter?

We'll have a recall of 100%, after all, recall just cares about not missing shoplifters, not about false accusations on customers (False Positive).

We basically replace False Negatives with False Positives in the denominator.

- Out of all the positive classes we have predicted correctly, how many are actually positive.

Or

- How good is our model at not making false accusations?

By this point, you might've guessed what problem we will encounter if we only optimize for high precision in our model.

The model can just call everyone not a shoplifter and have high precision.

Recall and precision are related such that high precision leads to low recall, and low precision leads to high recall.

We obviously want both to as high as possible, is there any metric that combines both precision and recall?

The F score is the harmonic mean of precision and recall.

The harmonic mean is a special type of mean(average) which is explained by this formula.

We use this mean instead of the normal mean because the normal punishes extreme values.

This translates to our model being able to catch shoplifters and at the same time not falsely accuse innocent customers.

The model will be sure when it catches a shoplifter that it is actually a shoplifter and that brings this story to an end.

Over the next few months, I will be explaining even more evaluation metrics like the F score.

If you enjoy such content, make sure to subscribe to my newsletter .

]]>a=b (read as "a to the power of c equals b") is an exponent where a,b and c are numbers.

a=b just means that a multiplied by itself c amount of times is equal to b.

Here are some examples:

- 2 basically means 2 multiplied by itself 2 times which is 4
- 2 basically means 2 multiplied by itself 3 times which is 8

So on and so forth.

Logarithms are basically a way of representing exponents in a different format.

Let me show you what I mean, both the formulas that you see below are equal.

logb = c is basically saying that "a to the power of c = b".

Dare I say, logarithms are exponents in disguise.

Here's a small exercise for you, what is the value of c in the below equations?

I've put them in logarithmic and exponential notation to make it easy for you.

Logarithms are used in all sorts of places, machine learning, computer science (time complexities)... you name it.

They are also a bunch of logarithmic properties that we can use to our advantage, but that is something I'll discuss in another blog post.

I really hope you enjoyed this blog post, you can also subscribe to my newsletter where I post bite-sized content like this.

Peace out!

]]>It is a library using which we can develop real-time computer vision applications. It mainly focuses on image processing, video capture and analysis including features like face detection and object detection.

But before that....

When I was in 7th grade (3 years ago), I used to play with this photo editing software called " GIMP ". (short for GNU Image Manipulation Software)

Using a couple of clever techniques, I would make sketches out of images like what you saw in the thumbnail.

- You take an image

- Convert it to grayscale

- Invert the grayscaled image

- Blur the inverted image

- Subtract the grayscaled image from the blurred inverted image

et voil!

I figured that I could automate this process using OpenCV, let see the code and how it works.

`import cv2# Importing the OpenCV libararyimg = cv2.imread('image.jpg')#Reading the imageimg_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)#Converting the image to grayscaleimg_invert = cv2.bitwise_not(img_gray)#Inverting the grayscaled imageimg_smoothing = cv2.GaussianBlur(img_invert, (21, 21),sigmaX=0, sigmaY=0)#Blurring the inverted imagedef dodge(x, y): return cv2.divide(x, 255 - y, scale=256)final_img = dodge(img_gray, img_smoothing)#Subtracting the blurred iamge from the orignal imagecv2.imwrite('img.jpg', final_img)#Writing the final output to a a file`

Just like that in 9 lines of code, you can easily create skteches using OpenCV and Python!

Here's the Github repository with this code .

]]>If you don't know how to code or anything about what machine learning is, then this blog post is for you.

Python is a programming language that you can use for machine learning.

Now, why do I recommend Python over any other language?

- It is easy to learn
- Has the largest community for machine learning
- Lots of learning resources

Some of the important topics covered in this tutorial are:

- Lists
- List Functions
- Tuples
- Functions
- Return Statement
- If Statements
- If Statements & Comparisons
- Dictionaries... and lots more

Getting through this course will take you about 12 days if you spend an hour and a half on it each day. Take your time to understand every concept and ask for help online if needed.

Make sure you're consistent.

This video series by 3blue1brown will help you understand how neural networks work.

It will take you roughly 3 days to complete this series.

Neural networks are just one part of machine learning, there are many other "classical" machine learning algorithms as well.

However, to keep things simple, we'll only be focusing on neural networks.

Now it is time for you to dive into machine learning, this 10 part course will teach you the fundamentals of machine learning in TensorFlow.

You'll learn about:

- Neural Networks
- Computer Vision
- Overfitting
- Convolutions and pooling
- Image Augmentation
- Natural Language Processing

This roadmap will provide a solid foundation to your machine learning journey, cheers!

Before you leave, make sure to follow me on Twitterπ

]]>When you work in python, you'll be working with several frameworks and many of them work only on specific versions of python.

Now imagine downloading a new version of python and then installing it for every framework you want to work with. π¬

Meet Anaconda which allows you to run several versions of python. It comes pre-installed with several data sciences and machine learning frameworks.

Pip-env is also a way of maintaining several versions of Python and comes pre-installed with Python.

You can use pip env or Anaconda, whichever works best for you.

Jupyter notebooks is an IDE just like VS Code or Sublime. The special thing about Jupiter is that you can parts of code in mini code editors called cells. This is great for prototyping and testing code.

Collab is a jupyter notebook running on google's servers which gives you access to GPUs and TPUs for training machine learning models faster for free, yes free.

I like to call Kaggle the codepen for machine learning and data science. This is the place where you show off your machine learning skills. You have access to datasets for which you can make machine learning models and compete with other people around the world.

TensorFlow is a framework for machine learning,it has variants like TensorFlow.js for machine learning in the browser, TensorFlow lite for machine learning on mobile phones, and the standard TensorFlow library.

PyTorch is an open-source machine learning library based on the Torch library, used for applications such as computer vision and natural language processing. It is very similar to TensorFlow in the things you can do in it with differences in the syntax.

Matplotlib is a library for plotting data into pie charts, bar charts, and whatever kinds of graphs you can imagine.

Numpy replaces the lists in Python with its lists, but why? Aren't the default lists good enough? The thing is that NumPy lists are much faster than Python lists, hence the wide usage of NumPy.

SciKit learn is a machine learning library that features various classification, regression, and clustering algorithms including support vector machines. These are complex computations you may need in training your machine learning model.

Pandas basically allows you to interact with Data in CSV files, databases etc. using something called a "dataframe".

]]>Quick disclaimer: This blog post was sponsored by MindsDB. However, what you read below is my honest opinion about their product.

Recently, the field of productionizing machine learning models using pipelines and several application layers, popularly known as 'MLops', has become a rapidly growing field, and for a valid reason. The number of companies that are using machine learning models in real-world applications grows larger day-by-day.

Such systems are usually very complex; this complexity is due, for the most part, to the application layer between the database and the frontend. MindsDB's AI Tables aims to provide an innovative solution to this problem.

Today, most machine learning applications in the real world are structured like this. π

You have the front end, the presentation layer, the backend, the application layer, and then the data layer, connecting the backend to the database(s).

All these layers work together to make the application functional.

Today, most companies have their data stored in traditional relational databases like MySQL, PostgreSQL, MariaDB, etc. Using data stored in these databases to train and deploy our models can be a very tedious task.

Wouldnt it be great if there was a way to train and deploy machine learning models in the database and not worry about the application layer?

"Anyone that has dealt with Machine Learning understands that data is a fundamental ingredient to it. Given that a great deal of the world's organized data already exists inside databases, doesn't it make sense to bring machine learning capabilities straight to the database itself?"

~ MindsDB Documentation

Typically, we query data that exists in a database. Data that is not present in the database obviously cannot be accessed.

An AI Table differs from a typical DB Table in that it can generate data upon being requested.

This is based on both, a model and the data in other tables, basically giving regular databases the superpowers of machine learning without the hassle of writing tons of code.

Notice how Dave's debt was not present in the database?

AI Tables filled it with a predicted value based on a machine learning model.

It looks like a normal database query!

This is how AI Tables are supposed to work.

I followed MindsDBs documentation and YouTube tutorials. The docs were well written, though I wish they had more instructions on setting up the database itself. The youtube videos were not the easiest to follow and had room for improvement. I felt that it was more like a general overview than an in-depth guide going over each step, which I would prefer.

Nonetheless, I started out with their colab starter example, which is a great way to get a feel for how mindsDB works.

I got started with Ai tables in Postgres using the docsAnd the YouTube tutorial π

The YouTube tutorial wasnt really that great, I felt that it was more like a general overview than an in-depth guide going over each step, which I would prefer.

After getting in touch with one of the engineers at MindsDB I was able to get a Postgres database with the housing dataset setup.

Using mindsDbs GUI I was able to:

- Check the quality of the data

- Train Models in a few clicks

- Make predicted queries

All-in-all, I feel that MindsDB has a very innovative product that works just as advertised. It can be helpful to a wide range of people and companies who are looking for simple yet effective solutions for deploying machine learning models.

Did I mention its open-source?

Check out MindsDB AI Tables hereπ

]]>It sounds really complicated but it isn't.

Let's talk about it.

Pre-requisites to follow along: None.

The generator generates images(in this case) and the discriminator tries to identify if the images made by the generator are real or fake.

Essentially putting 2 neural networks in a fight against each other.

- We have a generator that generates images of a 10 dollar bill.

Here are some of the rules:

The discriminator tries to determine if it is fake or not.

For every image that it recognizes correctly whether it's fake or real, it receives a point.

A point is deducted for every mistake it makes.

The discriminator easily detects the fake photos generated by the generator.

Discriminator's Score: 1

The discriminator still correctly detects that it is a fake but it's getting tougher every time.

Discriminator's Score: 2

(Notice that there is a small brown box on the left corner in the generated image as a defect)

The discriminator is fooled and it loses a point. π’

Discriminator's Score: 1

The discriminator realizes that it has made a mistake and learns from it. This process continues and the discriminator learns and improves after every iteration.

GANs can also be applied in NLP (Natural Language Processing).

In fact, that is how GPT-3, one of the world's largest neural networks, was trained on text data.

If you liked this blog post then share it with your friends who might find this useful.

I'm planning on exploring more topics in machine learning like image augmentation, CNNs using through these blog posts.

Keep Learning!

]]>What is 'Linear Algebra' and how is it used in machine learning?We'll answer just that in this blog post.

Prerequisites to follow along: None.

This is the heart of Linear Algebra.

A matrix is essentially a bunch of numbers stored between 2 brackets in a tabular manner.

Here are a couple of examplesπ

- Pixels in an image

Left is an image of '8' and on the right is a matrix showing the numerical values of each pixel (black-0, white-255).

- Tabular Data from an excel sheet.

`matrix = [[1,2,3], [4,5,6], [7,8,9]]`

'i' denotes the number of terms on the Y-axis and 'j' denotes the number of terms on the X-Axis in the Matrix.

'Transpose' is one way to transform a matrixImagine you have an imaginary line going from the top-left corner of the matrix to the bottom right, and then you interchange the opposite values.

The matrix you get after switching the values is the transpose of the matrix.

Think of a transpose as flipping the matrix along the red line.

In mathematical notation, a transpose is denoted by a small 'T' at the top of the letter that was originally assigned to the matrix.

There is a special type of matrix called the 'identity' matrix.

They look like this (basically the top-left to bottom-right diagonal consists of 1s and the other values are 0s.

We can also add, subtract or multiply matrices.

Adding and subtracting matrices is as simple as adding/subtracting the corresponding values of the matrices.

On the other hand, multiplying matrices is a bit tricky.

It looks somewhat like thisπ

It probably doesn't make sense, which is why you should look at this site.

Let's say we want to make a machine learning model that can recognize numbers in a given image.

We can't just give this image to a computer and ask "Hey, what number is in this image?"

We need to convert that image into something that a computer can understand, like a LoL (List of Lists π) which is a representation of a matrix in Python.

Many times we need to transform this matrix in a way that our machine learning model wants it to be.

It could be a transpose, addition, or multiplication but I won't get into the specifics of it.

Scalar: Just a number

Vector: A row or column of numbers between brackets

Matrix: Numbers in a tabular form between brackets with multiple rows and columns.

Of course, this isn't everything and there are many, *many more * concepts in linear algebra used for machine learning.

However, this blog post covers a lot of the basics of Linear Algebra that you'll need for machine learning.

If you liked this blog post then share it with others so that they can benefit from it.I am planning to make a similar blog post for calculus and I'd love to hear your thoughts in the replies.

Keep Learning! πͺ

]]>I still remember how I wrote my first piece of code 6 years and all the amazing and cool things I've been able to do with it ever since.

Make sure to keep in mind that it is probably best for you to keep your expectations in check.

Don't expect to make AAA games or state of the art machine learning models in a week.

Programming is not something that you can learn in a single week, it takes consistent effort and dedication over time to get good at it.

With all that being said, let's dive straight in.

In order to write Python code, you'll need to install Python on your system.

Linux and macOS users can skip this step because they come pre-installed with Python.

Click on the .exe file and follow the instructions.

Make sure to Add python to path by checking this option π

Now you need to install a place where you can write your Python code, just like how you write your essays in Word or Google docs.

We'll be installing VS-Code, one of the best code editors out there and it's free!

Fortunately, Microsoft has this wonderful guide that'll help you out.

In case you are unable to set up Python on your own system then I recommend using repl, a great way to write and run Python code without any hassle.

Here are the topics you should be focusing

- Printing statements
- Variables
- Operators
- Conditions
- Functions
- Loops

Let's take a closer look.

You can 'print' or output in Python using the print() function.

print('Hello World') will give you an output of `Hello World`

These store certain values that can change.

For example, You can declare a variable 'x' with a certain value.

`x = 9 #Here 9 is assigned to variable xy = 'Hello World' #'Hello World' is assigned to yx = 8 #x has been updated to a new value which is 8`

These carry out arithmetic operations in Python

They look like this π

`a = 33b = 200if b > a: print("b is greater than a")else: pass`

Think of it as telling Python to do something based on conditions: if this is true, do this; else do something different.

These are basically blocks of code that can be run when you call them. This helps us write code more efficiently.

In Python, you can make functions using the def keyword.

`def myFunction(): print("Hello")myFunction()`

These essentially run a piece of code over and over again until a certain condition is met.

There are 2 types of loops in Python:

- While loops
- For loops

Let's take a look at them.

`i = 1while i < 6: //While i is less than 6 print(i) // do i += 1 //this`

The output is :

`12345`

Here's a For loop

`fruits = ["apple", "banana", "cherry"]for fruit in fruits: print(x)`

The output:

`applebananacherry`

The for loops can be a bit tricky to understand, let me try to break it down for you.

'fruit' is the above loop is a temporary variable. It gets a value from the list called 'fruits' starting from "apple" then to "banana" and then "cherry".

All that I explained before was to give you a taste of the basics of Python, having strong fundamentals at this stage is very important.

These are some of the resources I would recommend to you for further learningπ

Programmiz Text-based Python Tutorials

Objected Oriented Programming (advanced) : %[http://youtube.com/watch?v=MikphENIrOo]

This course on Traversy Media's channel is a great next step for taking your python skills to the next level!

Python Documentation: http://docs.python.org/3/

This is probably the most underrated resource for learning python.

]]>You can pick the up the math as you go deeper into machine learning and one can comfortably start machine learning without it.

The point of this blog post is to help you get started with machine learning, not to proclaim that math is not important.

For this exercise you'll have to know basic programming knowledge in Python, that's it!

We are given data in which we are given the number of flats in a house and its corresponding price. Like a house with one flat is worth 10000, and 20000 for a house with two flats.

We can clearly tell that the price of the house increases by 10000 per extra flat however our computer does not know this and we won't it tell it about this, it'll have to figure things out on its own π€«

Here's the code

( The link opens in Google colab, an online editor wherein your code runs on google's servers, no setup for Python or Tensorflow required on your PC! )

Let's try to understand what is going on here.

We import TensorFlow and Keras which are frameworks for making neural nets

Our Neural Net: This is where all the magic happens, for this exercise we need only one neuron.

Neural Networks are a digital imitation of the neurons you see in the human brain.

In these neural networks, data flows through them and each neuron (the circle) has a numerical value which will change.

The value of a neuron gets changes to something which is close to what we want each time the data passes through the neural network.

Think of the neurons as dials on a lock, you have to tune every dial to open the lock.

It is almost impossible for a human to tune thousands of dials like these, but a computer certainly can.

Once the dials are well tuned, you have a well trained neural network!

In this case we'll be able to predict the prices of houses based on how many flats they have.

Let's move on.

Now we pass the data (flats and prices) through our neural network 500 times. (these loops are called epochs)

Finally,we predict what the price of a house with 10 flats. (we should get something around 100,000)

And that's it! It was that easy.

Did we use any complex math? No!

This proves that you can get started with machine learning without any math.

What excuses do you have now?

]]>Until...

This year when I across these free resources which helped me in a massive way!

Here's everything you need to know about math for machine learning and resources that you can learn from.

In Python, these are the concepts which you must know:

- Object oriented programming in Python : Classes, Objects, Methods
- List slicing
- String formatting
- Dictionaries & Tuples
- Basic terminal commands
- Exception handling

If you want to learn these concepts for python, these courses are freecodecamp could be of help to you.

You need to have really strong fundamentals in programming, because machine learning involves a lot of it.

Math for machine learning should come after you have worked on some projects, doesn't have to a complex one at all, but one that gives you a taste of how machine learning works in the real world.

Here's how I do it, I look at the math when I have a need for it.

For instance I was recently competing in a kaggle challenge.

I was brainstorming about which activation function to use in a part of my neural net, I looked up the math behind each activation function and this helped me to choose the right one.

It goes over machine learning without any of the math, this will get you more comfortable with machine learning.

The topics of math you'll have to focus on

- Linear Algebra
- Calculus
- Trigonometry
- Algebra
- Statistics
- Probability

A series of videos that go over how neural networks work with approach visual, must watch.

This website gives you an interactive to learn statistics and probability

They're 15 years old but still 100% relevant today!Despite the fact these lectures are for freshman college students ,I found it very easy to followπ

A beautifully crafted set of videos which teach you linear algebra through visualisations in an easy to digest mannerwatch?

Essence of calculus

A beautiful series on calculus, makes everything seem super simple

The math for Machine learning e-book

]]>This is a book aimed for someone who knows quite a decent amount of high school math like trignometry, calculus, I suggest reading this after having the fundamentals down on khan academy.

- How does Ai work?
- Tensorflow.js: What is it?
- Deploying your Ai enabled App
- Now what?

In very simple terms, Ai learns through trial and error. It is given loads of data, which could be images, texts or even voice data.

The Neural Net recognises patterns in the data and learns from it.

Let's understand with the help of an example.

Tom is a 3 year-old boy, he does not know the difference between a dog and a cat.So we try to teach him what a dog looks like and what a cat looks like.We have to stacks of images, one with cats and one with dogs.

We show Tom pictures of dogs and cats and after he has learnt what they look like, we try to test how much he has learnt.

In order to learn the differences between the dogs and the cats he must have looked at the characteristics of them, for eg: Dogs are taller than Cats.

Let's say we asked him to identify 10 random images which have both cats and dogs(mixed), and he answers 8 correctly, he has a 80% accuracy.

Now simply replace Tom with a computer and you have Machine Learning, incredibly easy to understand, isn't it?This kind of Machine learning is called "Supervised learning".

Tensorflow.js is a Js library by Google which allows us to make Machine learning models(the thing we did above) for the the browser.All computations happen in the clients' browser this means your web app is 100% privacy friendly as no data is sent back.

The cool thing about TensorFlow.js is that you don't even need to train your own models to use Ai!You can use pre-trained models which you can simply import in your project.This is fine when you're starting out but it is recommended that you train you own models.

Now take a look at this tutorial: Google CodeLabs tutorial

Deploying a Tensorflow.js web app to the web is super simple.

Push to a Github Repo and then import it in Vercel/Netlify, just like a normal website deployment.

Here's an Web App I made using Tfjs:Digit Recognizer Using MNIST Dataset

In a future thread we'll a more in depth look on how a neural network works and some other concepts.

Sometimes, your application may be running slow and it can be really difficult to know what part of the code is causing the issue, to solve this you can look at the time taken by certain parts of the code by using this code snippet π

`import timestartTime = time.time()# write your code or functions callsendTime = time.time()totalTime = endTime - startTimeprint("Time taken to execute code= ", totalTime)`

In Python you can use the `sys.getsizeof`

function to check the memory consumed by an object in python, like Lists, Tuples, Dictionaries etc.Sometimes, it is good practice to check how much memory your data structure uses.

`import syslist1 = ['Value1', 'Value2', 'Value3']print("size of list = ",sys.getsizeof(list1))`

π« Don't do this π

`a = 10b = 20a = bb = cc = aprint(a,b)`

Do this π

`a = 10b = 20a,b=b,aprint(a,b)`

This is a neat trick, here we convert the list to a set.Sets are unordered data-structures of unique values and dont allow copies.

`listNumbers = [20, 22, 24, 26, 28, 28, 20, 30, 24]print("Original List= ", listNumbers)listNumbers = list(set(listNumbers))print("After removing duplicate= ", listNumbers)`

Here we use the `zip`

function to combine the 2 lists into a dictionary

`price = [54, 65, 76]names = ["Pizza", "Pasta", "Burger"]convertedDictionary = dict(zip(price, names))print(convertedDictionary)`

For extracting the largest and smallest values from a list, we can use the `min`

and `max`

functions.

`list = [1,2,3,4,5,6] smallest = min(list)print(smallest)largest = max(list)print(largest)`

Let's say you want to make a list with even numbers from 0-20.

The typical approach would be:

`A = [i for i in range(20)]B = [x for x in A if x%2 == 0]print (B)`

The more efficient approach would be:

`A = [x for x in range(20) if x%2 == 0]print(A)`

I hope you found these tips and tricks useful.

You can find me on Twitter Here

]]>In this blog I'll explain how to crush these problems which I faced too, like a pro! Without further ado, let's begin:

Start from FreeCodeCamp Nothing else to say here

- Using the command line interface :
System File structure :

Json,Yaml files :

Add variables to PATH:

Learn to use package managers, like Pypi for Python, Npm for JavaScript, Flutter packages for you guessed it Flutter

Your first project should be a simple one, if you still feel its overwhelming break your project into several smaller parts, then work on them, in case you still feel stuck, feel free to approach your friend google or the Twitter Dev community. Moreover you have hundreds of blog posts like these, put them to good use.

In addition to this, you may also get bugsAs a Dev you will encounter bugs, the best way to deal with them is to **READ THE ERROR MESSAGE**, usually it will point to a line in the file which will help you fix the bug pretty efficiently, if not search it up on google.

Here are a few tricks on searching things on google by @frontenddude

Firstly, you should know that this is normal. Fix it by don't comparing yourself to others, everyone has different learning speed.

Take some time off, think about new ideas and how to execute, this often helps rejuvenate the mind and generally makes you more productive. Being in a good mental state for coding is important.

Lastly, the bitter truth is that coding is tough, REALLY TOUGH. There are no 2 ways around it but if you have the passion and dedication then it is certainly possible to become a developer and you got this!

Wish you all the very best in your coding journey.

]]>That is why we decided to teach them in a way which most programmers learn:

- The students would daily watch a video tutorial and follow instructions in it
- They would then solve challenges curated by our team
- Every weekend a doubt solving session was held wherein the concepts were quickly brushed upon and you guessed it, doubts were cleared

Now here are my main takeaways:

Especially younger students require spoon-feeding at times.Resources which were given to them had to be boiled down enough for them to grasp it.

Basic things like knowing what is an integer, string, variable etc. are very important, otherwise programming at a later stage becomes very difficult.

To put it bluntly, programming is very very tough.Takes months of learning to get good at it and there is always something new to learn.

This also makes you more confident.

Before asking doubts one must give a detailed explanation as to what they have tried and have they tried searching it up on the web?Bugs are inevitable and a coder must learn to google stuff when things don't work out

All went well and in the end we were able to help all the students to get a feel for what programming feels, our goal was not make full-stack 12-year-old prodigies who work at Facebook but to get them excited about programming and I feel we achieved our goal very well.

Hope you found this post insightful.Have an awesome day, Cheers.

Pictures from: Unsplash

]]>