Python is a computer language that we use to talk to a computer and tell it what to do.
It’s like English, but for computers:
Very easy to read and write compared to other programming languages.
You don’t need to remember very hard rules or symbols.
It is used everywhere — in making websites, apps, games, artificial intelligence, data science,
and even controlling robots.
2.Features Of Python
(a) Python is Case Sensitive.
---Lower Case Alphabets and Upper-Case Alphabets Treated Differently.
(b) Python Supports Procedural Programming (C/C++), Functional Programming, and Object-
Oriented Programming (Java).
(c) Python is not 100% Object-Oriented Because Method Over Loading is Not Possible.
(d) Python is an Open-Source Language, which is Free to Develop Applications and Projects.
(e) Python is Interpreted Programming Language.
---Code Executes Line by line, if any Error Occurs the Flow of Execution is Terminated.
(f) Python is Platform Independent Language
---Python Works Same in all Operating System.
(g) Python is Dynamic Programming Language.
---We Should never Mention the type of Data While Creating.
(h) Python Modules and Files are same.
(i) There are two Extension for Python Files.
(a).py (b).pyc
---By Default, all Python Files takes the Extension (.py). It Contains Source Code.
(j) Python is Used as Scripting Language (Other Scripting Languages like Python are: JavaScript,R).
---We can Connect Python Program with Multiple Languages and Can Create Multiple Web Pages.
3.Variable
---Variable is the Name Which is given for a Memory Location.
---Variable Names are Case Sensitive.
---To Find the location of a Variable We have id method and this must be used only for Memory
Location.
---Id Method is Written as id ().
Page |1
,---Id () can Find the Memory Location of One Variable at a time.
Examples: -
4.Identifiers
---Identifiers is Used to Identify the Variable Name, Function Name, Class Name, Object Name.
4.1. Rules of Identifiers
(a) Identifiers Should not Start with a Number.
(b) Special Characters are not allowed as Identifiers except Underscore (_).
(c) Keywords are not Used as Identifiers.
Example: -
Here ‘age’ and ‘name’ are identifiers.
(They are just labels we stick on values so we can use them again.)
5.Keywords
---Keywords are special reserved words in Python.
They already have a special meaning.
You cannot use them as variable names or function names.
Examples: -
Write a Python Program to Print all Keywords in Python.
Page |2
,Here in,
---Import keyword
Import=keyword
keyword=Module Name
and in,
---Print(keyword.kwlist)
Keyword=Module Reference
Kwlist=Variable Containing keyword
6.Python Memory Management
---Python never Creates Duplicate Memory Locations.
---If it tries to give Duplicate names the Old Values will replaced with New Value.
---If any Value don’t have any References, then the Values is Directed to the Garbage Collection.
---If Multiple Variables are having same Members, then Python will not Create New Memory
Location, In Stead It Shares the Memory.
---In Python, Every Variable can have Only One Value at a time.
7.Data Structure in Python
---Data Structure is a way of storing and organizing data in a computer so we can use it easily.
Just like in real life we keep clothes in a cupboard, books on a shelf, and money in a wallet.
In Python, data structures help us keep different kinds of data in proper places.
They are of Two types, they are:
7.1. Built in Datatype
---These are already available in Python. You don’t need to create them; just use them.
---Basically They are of 2 Types, they are:
(a)Single valued Data type (b)Collections Data type
7.2. User Defined Datatype
---These are not built into Python.
---Programmers create them using classes and objects to solve specific problems.
---They are of 5 Types, they are:
(a)Linked List (b)Stack (c)Queue (d)Tree (e)Graph
Page |3
, 7.1.1. Single Valued Datatype
---It is a data type that can store only one value at a time (not multiple values).
---Mainly It have 5 types, they are:
(a)Integer (b)Float (c)Boolean (d)Complex (e)None
7.1.1.1. Integers (Int): -
---If Any Object Belongs to Integer Class, then the Object is Considered as Integers.
---Any Number without decimal Point, is Called Integer.
---Integers can be Positive, Negative and Zero.
Examples: -
Page |4