Introduction to Python


Q. What is programming?

In layman’s terms, ‘it is the way to instruct the computer to perform various tasks’.

Now, the question is, who will instruct and to whom and why will he/she instruct? The simple answer is we will instruct to the computer to perform our desired tasks.

We need to understand the fact that Computer is merely a complex hardware device which in turn is useless without programs (or softwares); or we can say it is just a device to convert electricity into heat, without programs.

In order to understand ‘why’, we know that in this world there are many problems which is possible for us to solve manually but takes a lot of time and effort. On the other hand, computer is a machine which is capable of doing certain things like calculations very easily, accurately and with efficiency. So, in order to make our life more easier we need programming.

Q. Why programming?

In simple words, to make our life and our works easier and faster we need to program. And this programming or giving instruction to the computer must be in a language that follows definite symbols and should be properly structured. These symbols and the system to be followed are called as its Syntax. Just in the way we communicate in English while following a proper Grammar sequence.

 

PYTHON PROGRAMMING LANGUAGE

Why programming using Python?

·         First of all it is a high-level and one of the most popular, general-purpose language.

·         It is multi-paradigm that is it supports different techniques of programming.

·         Its programs are relatively smaller than other popular languages like Java, C++ etc.

·         In terms of popularity, we must know that it is used by many big tech giants like, Google, Amazon, Facebook, Instagram etc.

·         Also, it is known for its huge collection of its libraries.

Note:    Python was created by Guido van Rossum in 1991 and further developed by Python Software Foundation. Its main intention behind its development was to focus on code readability and a freedom to express concepts in fewer lines of code. Two major versions are available: Python2 and Python3.

Beginning with Python…

1.       Finding the interpreter: There are many IDEs available in the markets for various platforms like Windows, MacOS, LINUX, etc.

One such and much better IDE is Anaconda.

Note:    IDE (Integrated Development Environment): It is software which is bundled with various packages and tools combined together for software development. These generally contain a source code editor; build automation tools, and a debugger.

2.       Writing your first code:



Coding area is the place where we actually write or edit our code and Console is the region where our codes get executed.

Line 1: The statement starting with # is called a ‘comment line’ which is often ignored by the computer.

Line 2: The function ‘print(“hello Piyush!”)’ is telling the computer display a message i.e., hello Piyush.

Line 3: This is the other comment line which is telling that the code is completed.

Note: The comment line (beginning with # are often ignored by the interpreter and is used for the documentation of the program.

Advantages and applications/scope of Python


Ø  Advantages:

1.       It is a high-level language.

2.       Easy to read, learn and code

3.       User-friendly data structures

4.       Dynamically typed language (No need to declare the data types, it understands according to the value entered)

5.       Extensive Libraries

6.       Open Sourced

7.       Object-oriented programming

8.       Portable and interactive

 

Ø  Applications:

1.       GUI based desktop applications

2.       Graphic design, image processing applications, Games, and Scientific/ computational Applications

3.       Operating Systems

4.       Language development

5.       Software development

6.       Database Access

7.       Prototyping

8.       Web frameworks and applications


Note: Any variant of Python can be downloaded from the website of Python Software Foundation: www.python.org

Comments