Introduction_to_Python
Introduction_to_Python
Introduction_to_Python
So before learning what is programming, I want to ask you one simple question, why do you
use a computer or a phone, in my case I use it for google search, Meetings, a calculator, and
many more things.
So have you ever thought that how that device understands, what you want the device to
do when you click the calculator app button? This is done via programming.
A Program is a set of instructions that tells the computers what to do in order to come up
with a solution for a particular problem. When you instruct a computer to perform specific
tasks then this is called Computer Programming.
Programming Languages
Well, How does your teacher instruct you, Simply she uses a language as a medium
because you and the teacher both know the language like English. But what if one of you
doesn’t understand that language, in that case, you need to use another language which you
both know.
Binary or Machine Code
We know that Computers do not understand the language which we speak, like English.
Computers understand Only understand Machine language, also known as Binary
Language, technically speaking this is the only language which computers understand… for
example “01001000 01100101 01101100 01101100 01101111 00100001”
Those ones and zeros might not look like anything to you, but in binary code, these numbers
are actually saying “Hello!”.
Why machines can understand only Binary Language?
Why can’t computers understand English why only those 0s and 1s and the answers are these
0s and 1s contribute to a concept called truth table, and 0 is represented as false and
anything non zero represents true as there are only 2 numbers 0s and 1s in binary language
so 0 represents false and 1 represents true, well in short, to understand why computers
understand only machine code we need to see how a processor works.
Here’s how a processor works, the processor already contains the circuit to control all of
these instructions, but the correct circuitry gets connected together when, the instruction is
provided for that, for example, certain transistors will open or close with 1s or 0s, because as
we discussed 0 means false and 1 means true.
If everything was a bouncer for you then it’s totally fine you will be able to understand these
concepts clearly in the future,
so here is the representation of mostly used letters and symbols in machine code or binary
code.
Assembly Language
The Problem: We need to program the machine but it’s not easy to learn the Binary Code or
Machine language
The Solution: Due to this Assembly language was Introduced as a first step to improve
programming structure and make machine language more understandable by humans.
But wait we discussed that computer can only understand machine language so how it is
going to understand Assembly Language because it’s not in 0s and 1s, well it is simple, for
example when presidents of 2 countries want to talk to each other considering the fact that
they don’t understand each other’s language then you know how do they communicate? if
you said translators, then you are absolutely correct, they have translators who understand
both languages and can convert one language to another.
Similarly, Assembly language can be translated or rather converted into Machine level
language using Assemblers. So assemblers act as a translator between assembly language
and machine-level language.
High Level Language
Problems with Assembly Language: Assembly language was not as hard as Machine Level
Language but it was still hard for many of us, to understand the difference we can see the
same Hello world code in assembly language also.
So We need to find another language that is more human-understandable and simple to code.
Here comes the programming languages like Python, Java, C, C++. and these languages are
called High-Level Languages.
Which are way simpler to understand, to just compare Machine level language, assembly
language, and High-level languages we can see the same hello world program in python also.
What is Python?
Python is a High-Level Multipurpose Interpreted Programming language that is becoming
popular day by day.
Why to Learn Python?
1. Easy to Learn: Python has a clean and readable syntax, making it easier to understand
and learn, especially for beginners.
2. Versatility: Python is a versatile language that can be used for a wide range of
applications, including web development, data analysis, machine learning, scientific
computing, and more.
3. Active and Supportive Community: Python has a large and active community of
developers who provide support, resources, and share knowledge. This makes it easier
to find help and learn from others.
4. Extensive Libraries and Frameworks: Python has a rich ecosystem of libraries and
frameworks that offer pre-built functionality for various tasks, saving development
time and effort. Libraries like NumPy, Pandas, and TensorFlow are widely used in
their respective domains.
5. Rapid Prototyping and Development: Python's simplicity and readability allow for
quick prototyping and faster development cycles. It enables developers to iterate and
experiment with ideas more efficiently.
6. Job Opportunities: Python is in high demand across industries, and learning Python
can open up numerous job opportunities. It is particularly sought after in fields like
data science, machine learning, and web development.
7. Integration and Interoperability: Python can easily integrate with other languages like
C, C++, and Java, allowing for seamless interoperability and leveraging existing
codebases.
8. Scalability and Performance: Although Python is an interpreted language, with certain
optimization techniques and libraries, it can handle large-scale projects and perform
well in various scenarios.
9. Future Growth and Adoption: Python's popularity continues to grow, with a strong
upward trend in usage and adoption across industries. Learning Python now positions
you well for future opportunities.
History of Python:
1. Creation of Python (Late 1980s):
o Guido van Rossum, a Dutch programmer, started working on Python in the late
1980s.
o He wanted to create a language that was easy to read, had a clear syntax, and
emphasized code readability and simplicity.
2. Python's Early Development (1990s):
o The first version of Python, Python 0.9.0, was released in February 1991.
o Guido van Rossum named it "Python" after the British comedy group Monty
Python.
o Python's design philosophy, which emphasized readability and a minimalist
syntax, gained attention and popularity among developers.
3. Python 2 and Python 3 Split (2008):
o In December 2008, Python 3.0, also known as Python 3, was released. It
introduced significant changes and improvements to the language.
o However, Python 3 was not fully backward-compatible with the older Python
2.x versions.
o Python 2 continued to be widely used, and the Python community maintained
both versions simultaneously.
4. Adoption and Popularity:
o Python gained popularity due to its simplicity, readability, and versatility across
various domains.
o Its easy-to-learn syntax and extensive libraries contributed to its widespread
adoption among developers.
5. Python's Growth and Ecosystem:
o The Python community grew rapidly, and a vast ecosystem of third-party
libraries and frameworks developed around the language.
o Python became popular in fields such as data science, machine learning, web
development, and scientific computing.
6. Python Enhancement Proposals (PEPs):
o Python Enhancement Proposals (PEPs) were introduced to facilitate the
evolution and improvement of the language.
o PEPs outline new features, enhancements, and changes to Python, and they
provide a structured way for the community to contribute to Python's
development.
7. Python 2 End of Life (2020):
o Python 2 reached its end of life on January 1, 2020. No further updates or
security patches are provided for Python 2.x versions.
o The Python community now focuses on Python 3 as the recommended and
actively maintained version.
Details of Python
Application Examples
Web and Internet
Django, Flask, Bottle, Pyramid Framework, Plone
Development
Tkinter or Tk, Kivy (used for writing multitouch applications ),
Desktop GUI Applications
PyQt or Pyside
Software Development SCons, Buildbot, Roundup, Trac, Apache Gump
Fandango (Popular ), CAMVOX, HeeksCNC, AnyCAD,
Games and 3D Graphics
RCAM
Database Access Psycopg2, Pymongo
Business Applications Oddo, Tryton
Image Processing
OpenCV, Pillow, SimpleITK
Application
Machine Learning SciPy, Scikit-learn, NumPy, Pandas, Matplotlib Etc