What is Python? An introduction to Python
Published: 31 May 2020
•Last updated: 31 December 2023 at 10:52
4 min read
Tags:
What is Python?
It is a snake... It is also currently the fastest growing major programming language, standing in second place as the most loved language According to the stackoverflow Developer Survey 2019.
Why is Python called Python?
It was named by its creator, Guido van Rossum, after the popular TV show Monty Python. Some say that the creator named it after the popular TV show as he intended for it to be a popular language too [he has managed to achieve this]. However, the true reasons are relatively unknown.
What is the main use of Python?
Python is a very versatile language and has various use cases, part of this is due to the ever growing number of libraries available within the Python community. Be it a core library built into the Python language, or community built library there is usually always a package to fulfil any need in programming with Python.
Python is great for web development, having frameworks such as Django and Flask make development time rapid and applications can be up and running in just a short amount of time.
The language is also very popular for it's Data Science capability. The core libraries NumPy and SciPy, as well as Matplotlib make it easy for data scientists to work with their data to make conclusive findings.
Machine Learning, Artificial Intelligence and Deep Learning are also made very accessible with the With libraries such as TensorFlow [Google] and PyTorch [Facebook] being built by some of the most reputable software companies in the world.
What is Python and how does it work?
Python is an interpreted, high-level, general-purpose programming language that emphasizes on code readability.
Even as a beginner, due to its syntax resembling the English language, you can read through Python code and make some sense of what is going on.
Your computer, however, doesn't understand Python. Python language uses interpreters, just like you do as human when you don't understand another language, to translate it.
When the code is run, these interpreters will check the syntax, make sure it is all understandable and will then convert it to something that a computer can understand and execute. It is all rather smart.
What companies use Python?
There are many companies out there that use Python as a language to write their code. There are companies you will have never heard of using Python, but there are some big players that you will be very familiar with that use Python.
Google uses Python in their codebase, alongside C++, Java and Golang, it is one a few languages they recognize and support as an official language. Some of the Google developers actively contribute to the Python language and have even built TensorFlow, a very popular deep learning neural network library for Python.
Netflix is another company that relies heavily on Python for their server side code. They mainly use Python for their Data Analysis and for Security Management.
Instagram's servers are built on the Django framework and boast 800 million monthly active users. They choose Python due to its simplicity and practicality which aligns well with the Instagram philosophy, "do the simple thing first".
Other noteable companies that use Python are, Spotify, Dropbox, Uber and even reddit.
While Apple's operating systems on their computers are great for software development and even com pre shipped with Python. Apple do not use the Python language, they have their own programming language Swift which powers all of the operating systems and applications that ship with their devices.
What are the other uses for Python?
One of the more common questions asked is, can Python be used for hacking? The simple answer is yes. Python is a great language for hacking, its ease of learning for beginners, readability and available libraries make it the choice of language for hackers. It is primarily used by Ethical Hackers to expose bugs in code and test security features in websites as well as personal computers.
See some Python Code
Here is some Python code to look at, it replicates the Magic 8-ball. Ask a question and it will give you an answer.
python
import sys import random question = '' while not question == 'exit': question = raw_input("Ask the magic 8 ball a question: (type 'exit' to quit) ") answers = ["Outlook good", "You may rely on it", "Ask again later", "Concentrate and ask again", "Reply hazy, try again", "My reply is no", "My sources say no"] answer_choice = random.randint(1, 8) if question == "": print('Hmmmm, you may have forgotten to ask a question') elif question == 'exit': sys.exit() else: reply = answers[answer_choice] print('Your question: ' + question) print(reply)