Introduction and Installation of Python


Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most platforms.
Python was developed by Guido van Rossum in the late eighties and early nineties at the National Research Institute for Mathematics and Computer Science in the Netherlands.
Python is derived from many other languages, including ABC, Modula-3, C, C++, Algol-68, SmallTalk, and Unix shell and other scripting languages.
Python is copyrighted. Like Perl, Python source code is now available under the GNU General Public License (GPL).
Python is now maintained by a core development team at the institute, although Guido van Rossum still holds a vital role in directing its progress.
Local Environment Setup
Installation of Anaconda Python Distribution
Currently, there are two versions of Python. You can download and use either of them although the 2.7 version is preferable.
Installation of Anaconda Python Distribution(Windows set up)
You can install and run the Anaconda Python distribution on different platforms.
Jupyter Notebook:
Jupyter is an open source and interactive web-based Python interface for Data Science and scientific computing. Some of its advantages are:
Jupyter Notebook: Installation
To install Jupyter notebook on your system, type the below command on Anaconda prompt and press Enter to execute it.
Installation Command : Condo Install Jupyter
Launch Notebook : Jupyter Notebook
Getting Started : Quick Tour!!
In programming languages, a block of code is a set of statements that should be treated as a unit. In C, for example, code blocks are denoted by curly braces:
// C code
for(int i=0; i<100; i++) { // curly braces indicate code block total += i; }
In Python, code blocks are denoted by indentation:
for i in range(100):
    # indentation indicates code block
    total += i
In Python, indented code blocks are always preceded by a colon (:) on the previous line. Comments in Python are indicated by a pound sign (#), and anything on the line following the pound sign is ignored by the interpreter. 
The print() function is one piece that has changed between Python 2.x and Python 3.x. In Python 2, print behaved as a statement: that is, you could write
# Python 2 only!
>> print "first value:", 1
first value: 1
For various reasons, the language maintainers decided that in Python 3 print() should become a function, so we now write
# Python 3 only!
>>> print("first value:", 1)
first value: 1
This is one of the many backward-incompatible constructs between Python 2 and 3. As of the writing of this book, it is common to find examples written in both versions of Python, and the presence of the print statement rather than the print() function is often one of the first signs that you're looking at Python 2 code.This has been a very brief exploration of the essential features of Python syntax

No comments:

Post a Comment

Note: only a member of this blog may post a comment.