Python Links

PYTHON

Python is an easy-to-learn yet powerful object oriented, freely available, platform independent, very high level, General purpose programming language.

Introduction-
Python programming language was developed by Guido Van Rossum in February 1991. Python is based on or influenced with two programming languages:
ABC language, a teaching language created as a replacement of BASIC, and Modula-3
Python programming language, was named after famous BBC comedy show namely Monty Python’s Flying Circus.

Strengths of Python-

1. Easy to Use
2. Expression Language – It is more capable to expressing the code's purpose than many other languages. Reason being- fewer lines of code, simple syntax.
3. Interpreted Language
4. Its Completeness. (When you install Python, you get everything you need to do real work. You do not need to download and install additional libraries. For example, for diverse functionality such as emails, web-pages, databases, GUI development, network connections and many more, everything is available in Python Standard library.)
5. Cross-Platform Language. 6. Free and Open Source. 7. Variety of Usage/ Application.- Python has evolved into a powerful, complete and useful language over these years. These days Python is being used in many diverse fields/ applications, some of which are: Scripting, Rapid Prototyping, Web Application, GUI Programming, Mathematics, Game Development, Software Development, Database Application, System Administrations, etc.

Weakness/ Limitations of Python-

1. Not the Fastest Language
2. Lesser Libraries than C, Java
3. Not Strong on Type- Binding- Python interpreter is not very strong on catching “Type- mismatch” issues.
4. Not Easily Convertible

Installing Python-

As we know Python is freely available computer programming langauge, It can be downloaded from World Wide Web. (www.python.org/download/ )
Working in Python-We can work in Python in two different ways:
  1. In Interactive mode
  2. in Script mode

Interactive mode of working means you type the command- one command at a time, and the Python executes the given command there and then and gives you output.
In interactive mode, you type the command in front of Python command prompt >>> . For example, if you type 2+5 in front of Python prompt, it will give you result as 7:

The interactive interpreter of Python is also called Python Shell.

To print string “Hello” on the screen, we need to type-
>>> print (“Hello”)
Interactive mode proves very useful for testing code; we type the commands one by one and get the result or error one by one.
Type the following expressions one by one, in front of Python prompt >>>
6*3, 3**3, 6+2*4, (6+2)*4, 5- 3- 3, k=5- (3-3)
Interactive mode does not save the commands entered by you in the form of a program.
The output is sandwiched between the command lines.

In Script mode we save all the commands in the form of program file and we can see all output lines together rather than sandwiched between successive commands.

To work in Script mode, we need to do the following:

Step 1: Create Module/ Script/ Program file
Click File--New in IDLE Python Shell.
In the new window that opens, type the commands you want to save in form of a program.
Click File-- Save and save the file with an extension .py. The Python program has .py extension.
Step 2: Run Module/ Script/ Program file
Click File--Open and open the desired program file.
Click Run-- Run Module command (shortcut key- F5) in the open program file’s window.
And it will execute all the commands stored in module/ program that you had opened and show you the complete output in a separate Python Shell window.

In Script mode we can store all the commands together in the form of a module/ program and can get all output lines together.

OUTPUT-

What is the difference between interactive mode and script mode in Python?

In Interactive mode, instructions are given in front of Python prompt (>>>) in Python Shell. Python carries out the given instructions and shows the result there itself.
In Script mode, Python instructions are stored in a file with . py extension and are executed together in one go as a unit. The saved instructions are known as Python program.

PRACTICAL

OUTPUT

 

Tea Or Coffee

Python Downloads

DataFrame
Reindexing and Label Alteration
Function Application –Python pandas
Bar Charts and Histograms and Quantile
Plottint with PyPlot-2

Python Links

Python Fundamentals
Programming Construct
List, Tuple and Dictionary
Download NumpyArray Notes
Python Pandas Numpy Array
Python Pandas Series, DataFrame

Keep Your Brain Healthy