UNIT – IBASICS OF PYTHON PROGRAMMING
INTRODUCTION TO PYTHON PROGRAMMING:
Python was invented by Guido van Rossum in 1991 at CWI in
Netherland.
Python is a general purpose, Dynamic, highlevel, and Interpreted
programming gy7ulanguage.
It supports object oriented programming approach to develop Applications.
FEATURES OF PYTHON
1. Easy to learn and use.
2. Expressive language
3. Cross platform language
4. Free and Open Source
5. Object Oriented language
6. Large Standard library
Easy to Learn and Use:
Python is easy to learn and use as compared to other programming languages.
There is no use of the semicolon or curly braces.
Expressive Language:
Python can perform complex task using a few lines of code.
Ex:
print(“Hi”)
1
, O/P:
Hi
Cross Platform Language:
Python can run equally on different platforms such as Windows, Linux, Unix, Mac
etc., so that it is portable language
Free and Open Source:
Python is freely available for everyone.
It is freely available on it’s official website www.python.org Object
Oriented Language:
Python supports Object Oriented language, It supports inheritance, class, object,
polymorphism, etc.
Large Standard Library:
It provides a large range of libraries for various fields such as Machine Learning,
Web development and also for the scripting.
There are various Machine learning libraries such as Tensor flow, Numpy, Pandas,
Keras, PyTorch , etc.
Django, Flask, Pyramids are the popular framework for web development.
WRITING AND EXECUTING FIRST PYTHON PROGRAM:
There are three modes in Python
Interactive Mode
Script Mode
IDLE
,Interactive Mode:
Python provides Interactive shell to execute code immediately and produce output
instantly.
For using this method, write python coding in the Command Prompt and start
working with python.
Script Mode:
Using Script mode we can write our python code in a separate file of any editor in our
operating system, Ex: Notepad.
Save this code by .py extension, now open command prompt and execute it.
, VARIABLES AND IDENTIFIERS:
VARIABLES:
Variable is a name that is used to refer the memory location.
Python variable is also known as an identifiers and used to whole values.
In python no need to specify that type of variable.
Variable names can be a group of both the letters and digits but they have to begin
with the letter or underscore.
IDENTIFIERS:
It is used to identify the literals used in a program.
RULES:
The first character of the variable must be a alphabets or underscore ( _ ).
All the characters except the first characters may be an alphabet of lowercase
(a-z), uppercase (A-Z), Underscore ( _ ) or digits (0-9).
INTRODUCTION TO PYTHON PROGRAMMING:
Python was invented by Guido van Rossum in 1991 at CWI in
Netherland.
Python is a general purpose, Dynamic, highlevel, and Interpreted
programming gy7ulanguage.
It supports object oriented programming approach to develop Applications.
FEATURES OF PYTHON
1. Easy to learn and use.
2. Expressive language
3. Cross platform language
4. Free and Open Source
5. Object Oriented language
6. Large Standard library
Easy to Learn and Use:
Python is easy to learn and use as compared to other programming languages.
There is no use of the semicolon or curly braces.
Expressive Language:
Python can perform complex task using a few lines of code.
Ex:
print(“Hi”)
1
, O/P:
Hi
Cross Platform Language:
Python can run equally on different platforms such as Windows, Linux, Unix, Mac
etc., so that it is portable language
Free and Open Source:
Python is freely available for everyone.
It is freely available on it’s official website www.python.org Object
Oriented Language:
Python supports Object Oriented language, It supports inheritance, class, object,
polymorphism, etc.
Large Standard Library:
It provides a large range of libraries for various fields such as Machine Learning,
Web development and also for the scripting.
There are various Machine learning libraries such as Tensor flow, Numpy, Pandas,
Keras, PyTorch , etc.
Django, Flask, Pyramids are the popular framework for web development.
WRITING AND EXECUTING FIRST PYTHON PROGRAM:
There are three modes in Python
Interactive Mode
Script Mode
IDLE
,Interactive Mode:
Python provides Interactive shell to execute code immediately and produce output
instantly.
For using this method, write python coding in the Command Prompt and start
working with python.
Script Mode:
Using Script mode we can write our python code in a separate file of any editor in our
operating system, Ex: Notepad.
Save this code by .py extension, now open command prompt and execute it.
, VARIABLES AND IDENTIFIERS:
VARIABLES:
Variable is a name that is used to refer the memory location.
Python variable is also known as an identifiers and used to whole values.
In python no need to specify that type of variable.
Variable names can be a group of both the letters and digits but they have to begin
with the letter or underscore.
IDENTIFIERS:
It is used to identify the literals used in a program.
RULES:
The first character of the variable must be a alphabets or underscore ( _ ).
All the characters except the first characters may be an alphabet of lowercase
(a-z), uppercase (A-Z), Underscore ( _ ) or digits (0-9).