Getting Started With Python 3

Getting Started With Python 3

ยท

8 min read

Python is one of the languages that is witnessing incredible growth and popularity year by year. In 2017, Stack overflow calculated that python would beat all other programming languages by 2020 as it has become the fastest-growing programming language in the world.

Python is one of the most popular general-purpose, high-level programming languages in modern times. It is an elementary and widely used programming language because of its code readability.

The term general-purpose means that Python can be used for a variety of applications. And the term high-level language means it's close to human language. The main advantage of high-level languages is that they are easier to read, write, and maintain. Programs written in a high-level language must be translated into machine language by a compiler or interpreter. Python is an interpreted language because, during execution, each line is interpreted to the machine language on-the-go.

History ๐Ÿ“œ

Python was created in the late 1980s as a successor to the ABC language. It was developed by Guido van Rossum and was first released in 1991. While Guido van Rossum was implementing Python, he read the published scripts from Monty Pythonโ€™s Flying Circus.

Monty Pythonโ€™s Flying Circus is a BBC Comedy TV series from 1969+. It is a highly viewed TV series and is rated 8.8 on IMDB. Python programming language is highly rated too. According to a recent Stack Overflow survey, Python has overtaken Java in popularity.

python overtaken

Fig: Python has overtaken Java in popularity

Python is named after the comedy television show Monty Pythonโ€™s Flying Circus. It is not named after the Python snake.

Philosophy ๐Ÿง 

The language's core philosophy is summarized in the document The Zen of Python, which includes aphorisms such as:

  • Beautiful is better than ugly.
  • Explicit is better than implicit.
  • Simple is better than complex.
  • Complex is better than complicated.
  • Readability counts.

Rather than having all of its functionality built into its core, Python was designed to be highly extensible. This compact modularity has made it particularly popular as a means of adding programmable interfaces to existing applications.

Features ๐Ÿ’ผ

As a programming language, the features of Python brought to the table are many. Some of the most significant features of Python are:

https://i.imgur.com/u4OfzKl.jpg

Fig: Features of Python


๐ŸŽฏ Easy to Learn

Python is a very developer-friendly language, which means that anyone can learn to code it in a couple of hours or days.

๐ŸŽฏ Readability

One of the biggest reasons for Pythonโ€™s rapid growth is the simplicity of its syntax. The language reads almost like plain English, making it easy to write complex programs. Here is an example

a = 1
b = 1
if a is b:
    print("Hi")
a = 2000
print("Yeah!") if a % 2 == 0 else print("No!")

๐ŸŽฏ Object-Oriented Language

Python is Object-Oriented languages. The term object-oriented means it supports the concept of classes, method, object encapsulation, and many more. Here is an example code of OOP

class Car:
    def __init__(self, color, model, year):
        self.color = color
        self.model = model
        self.year = year

๐ŸŽฏ Free, Open Source and Cross-Platform

Python is an open-source programming language, which means that anyone can create and contribute to its development. Python has an online forum where thousands of coders gather daily to improve this language further. Along with this, Python is free to download and use in any operating system, be it Windows, Mac, or Linux.

๐ŸŽฏ Graphical User Interfaces

Python supports a wide array of GUIs which can easily be imported and make the results more visual. PyQt5 is the most popular option for creating graphical apps with Python.

๐ŸŽฏ Dynamic Memory Management

Python supports automatic memory management, which means the memory is cleared and freed automatically. You do not have to bother clearing the memory.

๐ŸŽฏ Exception Handling

Python supports exception handling, which means we can write fewer errors in code and test various scenarios that can cause an exception. Here is an example code

try:
    a=5
    b=0
    print (a/b)
except TypeError:
    print('Unsupported operation')
except ZeroDivisionError:
    print ('Division by zero not allowed')

-------------output ----------------------
> Division by zero not allowed

๐ŸŽฏ Highly Dynamic

Python is one of the most dynamic languages available in the industry today. It means that the type of a variable is decided at the run time and not in advance. Due to this feature's presence, we do not need to specify the variable's type during coding, thus saving time and increasing efficiency. Here is an example code in the C language

#include <stdio.h>

int main() {
    int a = 1;
    printf("%d", a);
    return 0;
}

Let's see the same code in Python.

a = 1
print(a)

๐ŸŽฏ Large Standard Library

Python has a large standard library which provides a rich set of module and functions, so you do not have to write your own code for every single thing. There are many libraries present in python for such as regular expressions, unit-testing, web browsers, etc.

๐ŸŽฏ Portable

If you are running Python on Windows and you need to shift the same to either a Mac or a Linux system, you can easily achieve the same in Python without worrying about changing the code.


Applications ๐Ÿ“ฆ

Apart from learning, Python is a very efficient language used in almost every sphere of modern computing. This makes a strong case for learning Python, even for non-programmers. Some of Pythonโ€™s main applications are highlighted below:

https://imgur.com/qg46Qqy.jpg

Fig: Applications of Python

๐Ÿ“Œ Web Development

Python can be used to make a web application at a rapid rate. That because the frameworks like Django, Flask are uses to create these applications. Python frameworks are known for their security, scalability, and flexibility.

๐Ÿ“Œ Game Development

Python is also used in the development of interactive games. There are libraries such as PySoy, a 3D game engine supporting Python 3, PyGame, which provides functionality, and a library for game development. Games such as Battlefield 2, Civilization IV, Disney's Toontown Online, and many more have been build using Python.

๐Ÿ“Œ Artificial Intelligence

A major advantage of using Python for AI is that it comes with inbuilt libraries. Python has libraries for almost all kinds of AI projects. For example, NumPy, SciPy, matplotlib, nltk, and SimpleAI are important inbuilt libraries of Python.

๐Ÿ“Œ Machine Learning

Machine learning and artificial intelligence are the most promising careers for the future. We make the computer learn based on past experiences through the data stored or, better yet, create algorithms that make the computer learn. Python has libraries for almost all kinds of ML projects. Libraries like Pandas, Scikit-learn, TensorFlow, and many more.

๐Ÿ“Œ Data Science and Data Visualization

Creating visualizations really helps make things clearer and easier to understand, especially with larger, high dimensional datasets. Libraries such as Pandas, NumPy help you in extracting information. You can even visualize the data libraries, such as Matplotlib and Seaborn, which help plot graphs and much more.

๐Ÿ“Œ Desktop GUI

Python an excellent choice for developing desktop-based GUI applications. Python offers many GUI toolkits and frameworks that make desktop application development a breeze. PyQt, PyGtk, Kivy, Tkinter, WxPython, PyGUI, and PySide are some of the best Python-based GUI frameworks that allow developers to create highly functional Graphical User Interfaces (GUIs).

๐Ÿ“Œ Business Application

Enterprise-level software or business applications are strikingly different from standard applications, as the former demands feature like readability, extensibility, and scalability. This is where Python can make a significant difference. Python high performance, scalability, flexibility, and readability are just the features required for developing fully-functional and efficient business applications.

๐Ÿ“Œ Web Scrapping

A python is a nifty tool for pulling a large amount of data from websites, which can help in various real-world processes, including job listings, price comparison, and so on. BeautifulSoup, Selenium, and Urllib are some of the best Python-based web scraping tools.

๐Ÿ“Œ Image and Video Processing

Image Processing is thus the process of analyzing and manipulating a digital image primarily aimed at improving its quality or for extracting some information from it, which could then be put to some use. Python offers many libraries, such as OpenCV.

๐Ÿ“Œ Embedded Application

Python can be used to create Embedded C software for embedded applications. The most well-known embedded application could be the Raspberry Pi, which uses Python for its computing. We can also use it as a computer or like a simple embedded board to perform high-level computations.

Conclusion ๐Ÿ‘Œ

In conclusion, Python is capable of handling almost any development requirement. No matter what field you take up, Python is rewarding. In the last few years, Python applications have gained newfound traction in Data Science, particularly in Machine Learning. Python is a great way to start a developer's journey.


๐Ÿšฉ๐Ÿ‘‰ If it was useful to you, please Like/Share to reach others as well. Please hit the Subscribe button at the top of the page to get an email notification on my latest posts.

I talk about web development and UI design on Twitter @kmhmubin, come to talk with me there!

The cover image is an improvisation on top of the work from DrawKit.

ย