title: Python Day 1 – Why Python, and What Even Is It?
So I started a Python course, and I'm going to write down what I learn each day here. Mostly for me, but maybe it helps someone else too. What is Python? Python is a general purpose, high level programming language . "High level" just means it's easy for humans to read. Compare this: no1 = 10 no2 = 20 print ( no1 + no2 ) with assembly, which is much closer to what the machine understands: MOV AL…
So I began a Python course and will document what I learn each day, primarily for my own benefit but hopefully it can be helpful to others as well. Python is a general-purpose, high-level programming language. This means it is designed to be easily readable by humans.
For example, a simple addition can be performed in Python like this:
no1 = 10
no2 = 20
print(no1 + no2)
In contrast, the same operation in assembly language would look much more complex and require detailed knowledge of the machine's internal workings.
Python finds applications in a wide range of fields - data science, machine learning and artificial intelligence due to its capability to handle large datasets efficiently. It's used to create web applications (with Django and Flask), desktop applications, scripting, automation tasks, games, Internet of Things (IoT) devices, network programming, and more.
Python was created back in 1991 (Java appeared a few years later in 1995). The Python 2 version was released in 2000 followed by the Python 3 version in December 2008. However, Python 3 isn't backward compatible with Python 2, hence the widespread use of Python 3 today.
Python is an interpreted language, meaning it translates the code line by line as opposed to compiling the entire program at once. There are several implementations of Python, namely CPython (the standard version written in C), Jython (Java), IronPython (.NET), and PyPy.
The pros of using Python include being simple, open-source, easy to read and write, extensible, high-level, platform-independent, and dynamically typed. The cons, on the other hand, are that it can be slower than languages like C/C++ and Java, consumes more memory, type errors are only caught at runtime, and it's not typically used for mobile app development.
As a small experiment, one could try importing the sys module and printing out the copyright notice - a quick way to check that Python is installed and functioning correctly. That completes Day 1 of my Python exploration.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.