PYTHON FUNDAMENTALS AT A GLANCE
INTRODUCTION
Python is a free and open-source programming language.
It was developed by Guido Van Rossum in the year 1989 and was
released in the market in the year 1991.
Open-Source Programming Language are those categories of
freeware languages where we can download the source code and
can make required changes as per specified standards . Either we can
keep those changes with ourselves or can share them with
community .Sharing the changes with internet community is known
as redistribution .
This language was inspired by the famous BBC comedy show i.e.
“Monty Python Flying Circus”. It is based on or influenced by two
programming languages i.e.
ABC language which was developed to replace BASIC language
Modula-3
The Python was named so because just like reptile Python, this
language is also very flexible, simple and easy to develop programs.
Thus, Python is easy to learn , powerful, interpreter based object-
oriented programming language. Though it is powerful high-level
language as many other mid-level languages but not so powerful like
C,C++,Java etc.
FEATURES OF PYTHON
1. It is very simple and expressive as its coding is very simple with
simpler syntax.
2. It is very easy to learn language.
3. It is platform Independent.
4. It is free, open-source language.
5. It is an interpreter-based language.
6. It has rich source of libraries.
7. It has less Interaction with hardware.
8. It is easily extensible object-oriented language.
9. It supports GUI (Graphical User Interface) programming.
10. Python is powerful ,complete and useful language ; therefore, it finds
its application in diverse areas such as scientific and non-scientific
programming.
11. It is Interactive and programs takes very less time to develop.
12. It is case sensitive language. (ASCII- American Standard code for
Information and Interchange-0-48, A-65,a-97,Carriage Return -13)
LIMITATIONS(Drawbacks)
1) Python offers faster development times but execution time are not
that much fast as compared to other compiled languages.
2) It consists of less libraries as compared to other counterpart
languages such as C,C++,Java, Perl etc.
3) Its interpreter is not as strong on catching “Type mismatch’ issues.
4) Mobile Development is at primitive stage.
5) Memory Consumption is on higher side.
6) Database Interaction is at primitive stage.
7) It is not easily convertible , i.e. though it is easy language to code but
difficult to translate in other programming language. It is so because
most other languages have defined syntax.
Installing Python- Official website to install Python is:
www.python.org/downloads
It is default installation of Python, also known as CPython installation
and comes with Python Interpreter, Python IDLE(Python GUI) and
pip(Package installer)
Interaction With Python:
TUser can interact with Python in two ways:
1) Shell mode/Python shell/IDLE (Interactive Development Learning
Environment) mode-This is the interactive mode of python. The
commands are typed on python prompt(>>>).The moment, enter key is
pressed after typing , the command is executed. The only drawback of
this mode is that commands of the session cannot be saved for later
reference.
2) Script Mode: If we want to save our commands for later reference in
the form of a program file, then script mode is used. To create and save
a script, we need to follow following steps:
a) In IDLE mode- Click file New--Type the commands- Click
on File--Save As.
b) This file is saved with the extension .py /. pyw
c) To execute this program click on Run menu-- Run module.
d) The program will be executed.
e) Alternatively we can press F5 shortcut key also.
POINTS TO PONDER
1) >>> on the application screen of python is known as Python prompt
2) Python file is saved with extension .py/.pyw.
SOME SHORTUT KEYS TO FOCUS UPON:
1) To execute Python program, the shortcut key is F5.
2) To repeat last command, short cut key is Alt+P
3) Quit() function or Ctrl+Q is press to exit from python.
4) Exit() function is also used to exit from python but for that
following commands needs to be written:
import sys
sys.exit()
It can also be used in the program to terminate the program
midway ,if the given condition is satisfied.
Terms to Focus Upon:
1) Syntax - Syntax refers to the general way of writing any command.
2) Semantics- Semantics are the grammatical rules of that language.
3) Commands- Individual instructions given to the computer in
Interactive mode is known as command.
4) Program- Set of Instructions given to a computer in logical order is
known as program.
5) Logic- Writing the steps to solve a problem through computer is
known as logic/logic development.
print() Function
print () function in python is used to display the output.
Syntax- print(value1,value2,……..[, sep=” “,end=” “][,file=sys.stdout])
ASSIGNMENT QUESTION:
1) When was Python released?
2) Who developed Python and which two languages contributed to
Python as programming language?
3) What are the advantages of Python?
4) Write few limitations of Python language.
5) Compare and contrast the features of two modes of interaction in
python.
6) Define the following terms:
a. Syntax
b. Semantics
c. Command
d. BUG
e. GIGO
f. Debugging
g. Command
h. Program
i. Logic
7) Briefly discuss the syntax of print() function with the help of an
example.
8) What is the significance of exit() function in Python.
9) Write the shortcut key for the following tasks:
a. To quit from Python
b. To execute any program
c. To repeat the last command