So what is Python really used for?
If you are really asking this question, then I am going to assume that you are a beginner who is not entirely sure if investing your time learning Python is a good choice.
I totally get it.
When you are new to the world of programming, it is easy to get overwhelmed by the sheer amount of programming languages.
You probably have received a lot of advice to start your programming learning journey with Python.
But you are still not sure.
What can you really do with Python?
In this article, I will try to enumerate all the main applications that Python is used for 🙂
Here are 5 things you can do with Python. Let’s get started!
0- Python is a general-purpose Programming Language
Let’s get this out of the way.
First and foremost, Python is a general-purpose programming language.
Like any other programming language, Python is a tool that you can use to build software. ANY software.
This is critical to understand and internalize because a lot of beginners think that they are boxing themselves into a corner by choosing one language over the other.
Don’t worry. You are not.
Whether you choose to learn C++, Java, or Python…you will be fine. They are all very popular languages that are very popular in our industry.
The TIOBE index is a well-known indicator of the popularity of programming languages.
As you can see, Python is really high up on the list!
In addition to its popularity, Python also has the advantage of being one of the easiest programming languages to learn.
So if you are completely new to the world of programming and you don’t know what language to start with, then I highly recommend you start with Python.
Python also lends itself very well to specific types of applications.
This is what we are going to discuss in the following sections.
1- Web Applications
Another area that Python excels at is for creating Web applications.
Many people are interested in creating their own web applications. Maybe you want to create your own personal website, or you want to have an online business.
Truth is, creating a web application involves having a solid understanding of numerous technologies (not just one) because there are so many involved.
To give you an example, let’s say you type yahoo.com on your browser.
your browser sends a request to the yahoo web server using a communication protocol called HTTP.
The yahoo web server receives this request and communicates with numerous backend services also using HTTP (or RPC).
Finally, your browser reads these files and renders the Yahoo homepage on your screen.
So how does Python fit into this picture?
Python can be used to program the backend services.
As you can see, in order to build a web application end-to-end, you need to understand many technologies.
However, there are some Python libraries and frameworks that make this job a little easier.
Flask is a microframework. It is a simple web framework capable of sending and receiving HTTP network requests.
Django, on the other hand, is a full-fledged web framework. It can do everything Flask does in addition to native support for authentication, authorization, and database modeling.
Both Flask and Django have strong communities and great documentation.
2- Numerical Analysis, Data Science and Visualization
When you hear numerical analysis and data visualization, usually a lot of random-looking numbers and fancy graphs float before your eyes.
We have studied and used these at school, but how can we connect this mathematical world with the programming world?
There are only a few programming languages that do this job well.
Python is definitely on top of this list.
Let’s talk about each one of these, and what they can do.
NumPy (short for Numerical Python) is a Python library specifically created to handle operations on multi-dimensional arrays in an efficient and fast manner. These operations include virtually any operation you can perform on a Matrix.
But can’t we just do matrix operations using regular lists in Python?
Long story short, NumPy is optimized for processing large amounts of numerical data. So it really boils down to performance.
When you have millions or billions of numbers to process, speed and memory consumption are crucial.
Alright, how about SciPy?
Scipy (short for Scientific Python) is a Python library for solving mathematical, science, and engineering problems. You can think of it as an abstraction on top of NumPy (it does actually use NumPy under the hood).
Some examples of the operations you can do with Scipy are Fourier transforms, numerical integrations, gradients, derivatives, and so much more…
now after you have all your numerical results, how do you actually visualize these results in a nice-looking graph or a pie chart?
This is where Matplotlib comes into the picture.
Matplotlib is a library for creating visualizations, like graphs, bar charts, line charts, pie charts, etc…
It can plot 2D graphs as well as 3D graphs.
Here is an example of how Matplotlib graphs look like. These examples are from the Matplotlib website.
3- Machine Learning
How many times have you watched a title on Netflix just because it was recommended to you? I guess it’s plenty.
How cool is it that your Amazon Alexa is able to understand you clearly most of the time?
These, and many others, are some of the examples that are powered by the fascinating branch of Computer Science – Machine Learning.
Though Machine Learning concepts existed in theory since the 1960’s, only recently has it started to get traction mainly due to the massive availability of computational resources, as well as the plethora of languages that made writing machine learning applications “easier”.
Python has become the “de facto” programming language for writing Machine Learning applications.
So if data science and machine learning are what you want to do in your career, then learning Python is a must!
So Karim, tell me, what Python libraries should I learn in order to write machine learning applications?
For one to develop a typical machine learning application, these libraries make the job way easier!
With these libraries, you will need to understand why you are using an ML algorithm, how it works, and its shortcomings but you don’t need to worry about “how it is implemented”.
However, I highly encourage you to understand the math and statistics behind the ML algorithms so that you can reason about the working of the model.
You see, anyone can learn how to use a library. What is going to differentiate you as a data scientist is your understanding of the fundamental concepts that underpin these machine learning algorithms.
So keep that in mind, it is only about learning how to use a Python library.
4- Raspberry Pi
When growing up, some of you wanted to build that fancy computer system your friend had bought. But you didn’t because of obvious reasons 🙂
Thanks to the evolution of processing resources, now you are able to buy a full computer at an affordable price.
For example, a very popular computer system is the Raspberry Pi.
A Raspberry Pi is a single-tiny-board computer that has all the components a typical computer would have in a single board that is as big as your palm.
It is generally used for learning purposes, but that shouldn’t stop you from using the Raspberry Pi to create some cool real-life projects.
OK that’s cool and all but how is this connected with Python?
Guess what? You can actually program your Raspberry Pi board using Python.
What I mean by that is not only can you write Python programs similar to the ones you write on a typical computer, but also you can program the hardware itself, interact with I/O pins, display LEDs, and even external devices. It is pretty cool!
I believe playing around with a Raspberry Pi is a perfect way to learn how software and hardware interact together.
Here is my precious raspberry pi. I am holding it on my palm so that you can get a sense of how small it is 🙂
I have been using it predominantly to monitor my real-time google analytics traffic on an external screen.
This is a straight-forward use-case.
Let’s talk about another more complex example.
One cool project that runs on a Raspberry Pi is PiCroft.
PiCroft is an open-source voice assistant similar to Alexa and Siri.
If one is able to build complex projects like PiCroft on a Raspberry Pi, imagine all the cool projects that you can build on it!
So go ahead, build something fun, and share it with the world.
Check out the Courses section!
Are you Beginning your Programming Career?
I provide my best content for beginners in the newsletter.
- Python tips for beginners, intermediate, and advanced levels.
- CS Career tips and advice.
- Special discounts on my premium courses when they launch.
And so much more…