Introduction to Python
Explore about Python Programming language and its basic command.
PYTHON SOFTWARE
Sathish M
2/26/20253 min read
Begin phase of python
Python was developed by Guido Van Rossum and came in action in late 1989. The name of python came from the famous BBC TV show "Monty Python's Flying Circus" in 1970s, as the author is a big fan of this show.
Python 1.0 was introduced in 1991, followed by 2.0 in 2000 and version 3.0 in 2008.
WHY PYTHON
Why Python: Python was used by much academic research as it has its own advantages like python tools do most of the work in various fields, the core libraries of python are
SciPy library (used for numerical integrations)
NumPy library (used to perform linear algebra, other mathematical operations)
Matplotlib library (used for data visualization)
Scikit-Learn (used for Classification, Regression, Clustering, Dimensionality reduction,...,etc in machine learning theory)
NLTK (known as Natural language processing, the most trending library as it mining the data from the text)
Pandas (specifically used for handling Data sets, as it stores the integers, floats, strings, objects and others)
Statsmodels (used for Cross-section, time series statistical analysis)
MySQL-connector-python (used to query from the database in MySQL)
Djano and Flask (used for web development, where Flask is used for mini web applications)
What is Python Community: It is the one which is responsible for python success, the members in the community constantly developing, adding, testing and sharing the features to the world. Python conferences are held once in a year, in which the developers are invited to share their thoughts which will make the language more efficient.
Environment
Anaconda Python distribution - comes up with major packages, in which "conda" manages all the libraries.
Jupyter notebook is a web application comes up with the webpage interface and easy to write, execute python code and compatible with visualizations. And it supports many programming languages. (Note: Anaconda navigator itself has the inbuilt jupyter notebook).
Will explore, python journey in jupyter notebook. Once you installed Anaconda navigator from Anaconda Python distribution, and then launch the jupyter notebook the window looks like,
identifiers, statement, expressions and data types
Identifiers: Names given to the variables, functions, class or module such that
Start with a letter not number.
Combination of lower and upper case.
Underscore used to separate the two names.
Can be one or more characters of length.
Not to use spaces between the names and special symbols.
Example: (statsfor_statistics is correct, 1statsfor_statistics is not correct, stats for statistics$ is not correct).
Note: Keywords (words which have predefined meaning in python) are not used as identifiers.
Python Keywords: and, or, not, TRUE, FALSE, NONE, def, if, elif, else, as, while, for, return, from, continue, break, class, del, pass, except.
Statement: A command which the Python can execute. Some example statements are
Assignment statement (q = 5)
Expression statement (x = q + 5)
Conditional statement (if, elif, else keyword used to run particular program)
Looping statement (for, while loops are executed over the entire sequence or executed until certain criteria meets)
Return statement (used to return the outcome value from the function)
Import statement (used to import a module)
Expression: A command which has the numerical values with or without mathematical operators. Example (8 + 8, q + 8, 8*8, 8/8, q*8, q/8)
Variables: It is an assignment statement used to store the data for the execution, but make sure the names should be
Name not to start with the number.
Not to use keywords.
Can be combination of letters, underscores, numbers.
Case sensitive (i.e., 'Stats' and 'stats' both are different in python language).
Example: (statsfor_statistics = 5, stats_for_statistics17 = "Statistics").
Note: Same variables are assigned with different values, then python will overwrite the value which is recently written for the variable.
Data types: Python reads the variable values as integers, floats and strings. (i.e., 100 is integer, 100.0 is float and "Statistics" is string).


In the jupyter notebook window, select the "New" button which is in the right side, and then select python [conda env:base] to lauch python window.


Python output for the above code