"What kind of language is the
programming language 'Python'?"
"I'm interested in Python, so
tell me the features and what you can do!"
Among the many programming
languages, "Python" is a particularly popular and demanding language.
Therefore, many people would like to
study Python as they start learning programming.
Therefore, in this article, we will
introduce the outline, features, things that can be done, basics of grammar,
etc. of Python in an easy-to-understand manner for beginners.
Please refer to it as an
introduction to Python.
What is
Python?
"Python"
is a server-side programming language mainly used in the fields of application
development and machine learning.
The origin
of Python is the English "python", and the language logo is also made
with the python as a motif.
Python is
easy to write code and features a grammar that is easy for beginners to
understand.
Applications
include application development using the framework for Python, data analysis
using abundant libraries, machine learning, and deep learning.
Python
history
Python is a
language created by Dutchman Guido van Rossum.
The
etymology of the language is said to be derived from the comedy program
"Flying Monty Python" of the British television station BBC.
The following is a brief review of the history of Python in chronological order.
· 1991: Python 0.9x released
· 1994: Python 1.0 released
· 2000: Python 2.0 released
· 2008: Python 3.0 released
The Python
3.X version is upgraded almost every year, and the latest version is
"Python 3.10" (as of November 2021).
What is
Python's share?
According to
"Top Programming Languages 2021" released by IEEE Spectrum, Python
ranked first as a popular programming language in 2021.
Jobs that
use Python include machine learning engineers, data scientists, and deep
learning engineers, who have become particularly popular in machine learning in
recent years.
It is also
used for embedded program development and web application development.
As you can
see, Python is gaining market share in all areas of system development and will
continue to be a fun language.
Features of
Python
The three main features of Python are:
· A language where the code is the same no matter who writes it
· General-purpose programming language
· Rich library
I will
explain the contents of these.
A language
where the code is the same no matter who writes it
Python is
designed with a language in mind that makes the code the same no matter who
writes it.
Therefore,
when reading the code, it is easy to understand the intention, and when writing
the code, you will not be confused about how to write it.
And an
easy-to-read language also means that it is easy to learn, and it is possible
to master it at a relatively low learning cost.
In addition,
Python has introduced an "indent" that adjusts the export position of
the program to make the structure easier to understand, realizing an
easy-to-read program.
Furthermore,
object-oriented programming makes it possible to program using classes and
objects even in complicated processing.
Python is a
language for beginners, and AI programming, which is a hot topic now, is also
possible, so it can be said that it is a language that IT engineers should
definitely keep in mind.
General-purpose
programming language
Python is
also known as a general-purpose programming language.
It
represents a language that is not specific to a particular application, and
there are many things that can be achieved using Python.
For example,
there are various ways to use it, such as automating document organization and
folder management on a personal computer with Python programming, and
performing science and technology calculations in research and development with
Python.
For more
information on what you can do with Python, see "What can you do with
Python?" Below.
Rich library
In AI
development, programming languages such as Java and C ++ can be used in
addition to Python.
However,
such cases are rare, and it is no exaggeration to say that "Python for AI
development" unless there is a special reason.
The reason
is that we have a wealth of useful libraries that strongly support AI
development.
For example,
if you use "Numpy" which is a numerical calculation library, you can
easily implement matrix calculation which is indispensable when creating AI
(especially those using deep learning).
Alternatively,
there are libraries such as "Pandas" that are useful for statistical
processing and data analysis, and "scikit-learn" that makes various
models of machine learning available.
And, such a
library has many blogs and online articles that summarize how to use it, and it
is easy to learn.
In addition
to AI-related items, we also have "Flask" and "Django" that
are useful for application development.
What can you
do with Python?
Here are four things you can do with Python.
· Application creation
· Data analysis
· Machine learning
· Web scraping
I will
explain these contents.
Application
creation
Python is a
programming language suitable for application development, and is used for
YouTube, Instagram, etc. in famous web services.
Python has
useful frameworks for web application development, the most famous ones are
"django" and "Flask".
Creating a
web app using AI with django
django is a
framework that allows you to create web applications using Python.
It features
high-speed development, strong security, and is used by many people.
The
advantage of using django is that it's easy to incorporate Python-based data
analysis programs and artificial intelligence programs into your web
applications.
Therefore,
if you want to use a data analysis program in a web application, learning
Python and django is the most efficient way to study.
Create a
simple web app with Flask
Like django,
Flask is a web application framework.
Flask is
very simple and is a very useful framework for implementing and running simple
applications.
The
framework is also very simple to use and is designed to be easy for beginners
to understand. If you are a beginner and have tried it from a simple app, Flask
is recommended.
Flask is a
very easy framework to run, but on the other hand it's not very good at
implementing complex functionality.
Therefore,
it's a good idea to change the framework you choose depending on how complex
you want to create your application.
Data
analysis
Python is
also a good programming language for data analysis.
By analyzing
big data held by companies, it is possible to find business issues and make
rational measures to increase sales.
In addition,
a job type that analyzes data using Python programming and analysis tools and
makes proposals for corporate management issues and profit improvement is
called a "data scientist".
Machine
learning
Machine
learning is one of the research fields in AI, and it is a mechanism in which
the computer itself learns and derives data patterns and rules in the same way
as humans learn.
Examples of
machine learning applications include autonomous driving technology, chatbots,
image recognition apps, and demand forecasting systems.
Web scraping
Web scraping
is one of the means to extract specific data from a website.
By utilizing
web scraping, you can extract specific data from multiple websites for
comparison, save it as a table or graph, and use it for marketing.
Python has
libraries for web scraping such as "Beautiful Soup" and
"Selenium".
Python grammar
This chapter introduces four basic Python grammars.
· Text output
· Four arithmetic operations
· repetition
· Conditional branch
The code to be introduced is executed at "Welcome to Python.org" where you can try executing the program on the spot.
Text output
Create a
program that outputs "Hello World!".
Text output
is possible by putting "" Hello World! "" In the
parentheses of "print ()".
Four
arithmetic operations
Addition is
described using "+", subtraction is described using "-", multiplication
is described using "*", and division is described using
"/".
It is also
possible to get the remainder after dividing, and use "%".
Repetition
For example,
if you want to display "Hello World!" 10 times, you can do it by
repeating "print ()" 10 times.
However,
when the number of repetitions is 100 or 1000, it is not very realistic.
A convenient
way to do this is with a "for statement" that you use repeatedly.
By using the
for statement, it is possible to describe the process to be repeated once and
execute the repetition by specifying the number of times to repeat.
The above
image is a program that displays "Hello World!" 10 times, and the
number in "range" indicates the number of repetitions.
Here, a line
with for means "execute i from 0 to 9 10 times".
It should be
noted here that i is "0 to 9" instead of "1 to 10".
As a test,
let's display i with the same repetition.
If you check
the above, i is displayed 10 times, but the display is "0 to 9".
As you can
see, programming often starts with 0, so it's a good idea to keep in mind.
Conditional
branch
The above
image is a program that determines whether a certain number a is larger than 9,
and if it is larger, outputs "" a is bigger than 9 "".
The basic
form of conditional branching in Python is "if conditional expression:
processing when the conditional expression is true".
Also, when
writing the processing when the conditional expression is false, add
"else: Processing when the conditional expression is false".
How to
install Python
Python can be
installed regardless of Windows / Mac / Linux.
Download
Python from the official website.
Go to the
official website and download the latest version of Python.
When the
download is completed and the package is opened, the above screen will appear.
Press and hold Continue to complete the installation.
There are past versions, but unless you have a specific reason, it's basically safe to install the latest version.
Let's try
simple application development with Python
For
beginners, we introduced the outline, features, things you can do, and the
basics of grammar.
Python is
highly versatile and is expected to be used in all situations such as web
application development, machine learning, and data analysis.
It is a
popular and demanding language, so if you want to start programming from now
on, you should study Python.
Once you
understand the grammar, try developing simple automation tools and apps.