SlideShare une entreprise Scribd logo
1  sur  8
Télécharger pour lire hors ligne
Anaconda Installation:-
What is Programming Language and Operating System and why do we need them?
A brief introduction to computer memory
Types of Programming Languages
There ARE MAINLY two types of PROGRAMMING LANGUAGE.
1. Low Level PROGRAMMING LANGUAGE
I. MACHINE Level LANGUAGE or BINARY Code
II. Assembly LANGUAGE
2. High Level PROGRAMMING LANGUAGE
I. BASED on purpose
i. GENERAL Purpose PL
ii. SPECIAL Purpose PL
II. BASED on converters used
i. Compiled —> C/C++/JAVA/PYTHON
ii. Interpreted —> PERL/JAVA Script/Python
There ARE MAINLY two types of memory in computer:-
1. VOLATILE Memory - PRIMARY Memory - TEMPORARY STORAGE - RAM, CACHE, Register
2. NON-VOLATILE memory - SECONDARY Memory - PERMANENT STORAGE - HDD, SDD, Floppy, CD, Pen Drive
-> Every PROGRAM runs into RAM.
-> SECONDARY memory ARE used for PERMANENT STORAGE.
A PROGRAMMING LANGUAGE is A set of predefined words thAt Are combined into A progrAm According to predefined
RULES(SYNTAX). PROGRAMMING LANGUAGES ARE used to develop the APPLICATION which helps in turn to get our TASK
done.
An OPERATING System is A SOFTWARE THAT ALLOWS A user to run other APPLICATIONS on A computing device. The
MAIN job of OPERATING system is to MANAGE computer’s SOFTWARE AND HARDWARE resources like I/O device, Network
device, STORAGE device etc. AND to run the APPLICATION on our system AND resource ALLOCATION required for the SAME.
1. HTTPS://WWW.ANACONDA.COM/PRODUCTS/INDIVIDUAL
2. HTTPS://REPO.ANACONDA.COM/ARCHIVE/
Sl
No
Low Level Programming Language High Level Programming Language
1 More closer towards system, less
closer towards user
More closer towards user, less closer towards system
2 Need to know the underlying
architecture of machine on which
you are coding
No need to know the underlying architecture of machine
on which you are coding
3 Bit complex to learn and write
the code, not manageable when
program grows and not ideal to
develop large application
Easy to learn and write the code, easily manageable
when program grows and ideal to develop large
application
4 As a programmer you need to
manage the memory and handle
the security issues in your program
Compiler or VM is responsible to manage the memory
and handle the security issues your program
5 Code is not portable. Code is portable.
6 Not expressive Expressive
7 e.g. Machine code, Assembly code e.g. C, C++, Java, Python etc
8 Sample code Sample code
What is Source code, Byte code and Machine code in Python?
Type of Errors in Python:-
Source Code:- The code, written to develop the APPLICATION. In python, (.-)file is source code.
Byte code:- A fixed set of instructions THAT represents ALL OPERATIONS like ARITHMETIC, COMPARISON, memory RELATED
OPERATIONS etc. The code GENERATED AFTER the COMPILATION of source code. (.pyc) file is byte code. Byte code is system AND
PLATFORM independent. It is ALSO CALLED p-code, PORTABLE code or object code.
PVM:- STANDS for Python VIRTUAL MACHINE AND is A SOFTWARE which comes with Python. PVM comes with Interpreter.
MACHINE code:- The code GENERATED AFTER INTERPRETATION of byte code. It is system AND PLATFORM dependent.
Compiled Languages vs Interpreted Languages
Why do we need translator?
Computer's HARDWARE ARE electronic devices AND they CAN not UNDERSTAND HUMAN LANGUAGE, RATHER they COMMUNICATE
with EACH other with the help of SIGNALS. SIGNALS Are nothing but BINARY code And is completely low level LANGUAGE. To
TRANSLATE High level lAnguAges in humAn reAdAble formAt to mAchine reAdAble formAt(binAry code), we need TRANSLATORS.
I.Compiled LANGUAGES needs compiler to TRANSLATE the code whereAs Interpreted LANGUAGES needs interpreter to
TRANSLATE the code from one form toANOTHER.
II. Compiler & Interpreter both ARE TRANSLATOR AND ARE computerPROGRAMS.
III. Compiler TRANSLATES the whole code from one form to Another form ALL AT once while interpreter is
instruction by instruction execution.
IV. In Python, Compiler is used to trAnslAte Source code to byte code whereAs Interpreter is used to TRANSLATE
the Byte code to MACHINE code.
V. All SYNTACTICAL errors Are cAught AtCOMPILATION stAge in Python whereAs All run time errors Are cAught AT
INTERPRETATION STAGE.
NOTE:- ORIGINALLY, Python is Interpreted LANGUAGE. But over the time, Python is MADE compiled AND
Interpreted both AS python HAS ESTABLISHED itself AS full fledged PROGRAMMING LANGUAGE AND is
ACCEPTABLE ACROSS wide AREA of APPLICATION.
[References:-]
1. https://en.wikipediA.org/wiki/Interpreted_lAnguAge
2. https://www.freecodecAmp.org/news/compiled-versus-interpreted-lAnguAges/
Error HANDLING is one of the most IMPORTANT FEATURE of Python. It WAS MAIN deciding FACTOR in development of Python.
There ARE MAINLY two type of errors in Python:-
I. SYNTAX Error CAUGHT AT COMPILATION STAGE
II. Run-time Error CAUGHT AT run time or INTERPRETATION STAGE.
SYNTAX & SYNTACTICAL Errors:- Every PROGRAMMING LANGUAGE comes with A set of rules which defines THAT how the codes will
be written AND interpreted or compiled. These set of rules ARE CALLED SYNTAX. Not following the rules MAY LEAD to errors which
ARE CALLED SyntAx errors. In Python, AT COMPILATION STAGE we check for the SYNTAX errors. If there ARE no SYNTAX errors in
your PROGRAM then it will be compiled successfully AND byte code will be GENERATED. If there ARE some SYNTAX error in your
PROGRAM then COMPILATION will not HAPPEN AND byte code will not be GENERATED. SYNTAX Error HAPPENS when Python CAN’T
UNDERSTAND WHAT you ARE SAYING.
Run Time Errors:- Run time error HAPPENS when Python CAN UNDERSTAND WHAT you ARE SAYING but runs into problem
while running your instructions. To find the list of ALL run time error you MAY execute the below code:-
>>> print(dir(“__builtins__”))
We CAN HANDLE runtime errors using exception HANDLING concept in Python unlike SYNTAX errors which HAS to be rectified before
COMPILATION. Run time errors MAY CAUSE PARTIAL IMPLEMENTATION of your code.
[Reference:-]
1. https://cscircles.cemc.uwAterloo.cA/1e-errors/
Why do we need Byte code?
Why Python is compiled and interpreted both? Can’t we make it either compiled or interpreted?
What is Python?
What is Python?Python is GENERAL purpose, High level PROGRAMMING LANGUAGE.
TRADITIONAL PROGRAMMING LANGUAGES like C or C++ were compiled LANGUAGES. If you execute ANY source code in C or C++, it
first CREATES AN EXECUTABLE file which is PLATFORM dependent AND then you run this file to get the output on THAT PARTICULAR
PLATFORM.
Source Code —> Compiler —> EXECUTABLE Code(.exe file) —> Output
You CAN see here THAT the INTERMEDIATE code which ARE GENERATED is not PLATFORM independent. But remember THAT the
Source code written in these LANGUAGES ARE PORTABLE.
So, to counter this problem, LANGUAGES like JAVA And Python were developed which Are first compiled to object code or Byte code
or P-CODE(PORTABLE code). These object codes ARE completely PLATFORM independent. Now when you move this object code to
other PLATFORM then you need to TRANSLATE it to MACHINE code. For TRANSLATION AT this STAGE, you MAY either use compiler or
interpreter, ANY TRANSLATOR which AGAIN TRANSLATES the byte code to MACHINE code. For INSTANCE, JAVA, PyPI, JPython uses JIT
compiler, where CPython uses interpreter.
Source Code —> Compiler —> Byte Code —> Interpreter or JIT compiler(PVM/JVM) —> MACHINE Code —> Output
So BASICALLY, we MAY SAY THAT to bridge the GAP between PORTABLE PROGRAMMING LANGUAGES AND PLATFORM independent
PROGRAMMING LANGUAGES we CAME up with this IDEA to HAVE two TRANSLATORS. First time it is used to GENERATE SHIPPABLE
code AND second time it is used to convert the byte code to MACHINE code.
[References:-]
1. https://en.wikipediA.org/wiki/Python_(progrAmming_lAnguAge)
2. https://www.geeksforgeeks.org/history-of-python/
3. http://effbot.org/pyfAq/why-wAs-python-creAted-in-the-first-plAce.htm
4. https://www.ArtimA.com/intv/python.html
Byte code ARE ALSO CALLED object code or p-code or PORTABLE code which MAY be be directly shipped to your client. As well AS it is
PLATFORM independent so it CAN run on ANY PLATFORM. Which MAKES service provider's AND developer's life EASY AS they do
not HAVE to write the code for the SAME APPLICATION to be used on different PLATFORM.
What are some good features of Python?
1. Simple & EASY to LEARN:- Python is one of the simplest LANGUAGE ever. SYNTAXES ARE simple, EASY to remember
AND quite expressive. When it comes to LEARNING, it HAS been found THAT the LEARNING curve for python is quite steeper
COMPARED to other PROGRAMMING LANGUAGES.
SAMPLe ProgrAm in JAVa to ADd two numbers:-
public CLASS ADD{
public STATIC void MAIN(STRING[]ARGS){ int A = 10;
int b = 20; int c = A+B;
System.out.println(c);
}
}
SAMPLe ProgrAm in Python to ADd two numbers:-
A = 10
b = 20
c = A+B print(c)
2. Most expressive LANGUAGE:- Being one of the most expressive LANGUAGE is EASY to write the code in fewer
lines, which LEADS to less cluttered PROGRAM, FASTER execution AND EASY to debug AND MAINTAIN.
3. FREEWARE AND open source:- Python being FREEWARE, you don’t HAVE to spend on licensing. And since it is open
source so its ORIGINAL source code is freely AVAILABLE AND CAN be redistributed AND MODIFIABLE.
4. Compiled AND Interpreted both:- ORIGINALLY, Python WAS developed to bridge the GAP between C AND
shell scripting AND ALSO include the FEATURE of exception HANDLING from ABC LANGUAGE. So we CAN SAY THAT, INITIALLY
Python WAS interpreted LANGUAGE. But LATER it WAS MADE compiled AND interpreted both.
GENERALLY, the steps involved in execution of ANY python PROGRAM ARE -
Memory Management in Python:-
In the ABOVE DIAGRAM, compiler is responsible to compile the source code. In the COMPILATION STAGE ALL the SYNTACTICAL
errors ARE checked WHEREAS interpreter is responsible to interpret the byte code AND check the run time error in this STAGE.
Compiler AND interpreter both ARE TRANSLATOR. Compiler TRANSLATES the source code to byte code(.pyc file) ALL AT once
WHEREAS interpreter TRANSLATES byte code to mAchine code one instruction At A time which interActs with HARDWARE to give
the FINAL output.
Few IMPORTANt commAnds:-
1. python FILE_NAME.PY —> To run the file
2. python -m py_compile FILE_NAME.PY —> To compile the file
3. python -m dis FILE_NAME.PY —> To see the byte code.
4. python FILE_NAME.CPYTHON-38.PYC —> To run the compiled code.
5. PORTABLE AND PLATFORM Independent:- Python is portAble And plAtform independent both. Source code is PORTABLE
WHEREAS byte code(.pyc file) is PLATFORM independent. C is PORTABLE but not PLATFORM independent.
6. DYNAMICALLY typed PROGRAMMING LANGUAGE:- In python, everything is AN object. Objects get stored in the HEAP AREA
AND it’s memory ADDRESS is referenced by the VARIABLE or NAME with which it is binded. Unlike other PROGRAMMING LANGUAGES,
In python, memory LOCATION does not work like A CONTAINER RATHER it works on reference model. No need to specify the DATA
type explicitly in python.
7. Extensible AND Embedded both - Extensibility - Extending the code from other PROGRAMMING LANGUAGES into Python
code. Embedded - Embedding Python code to other PROGRAMMING LANGUAGES code.
8. BATTERIES included:- Python comes with huge LIBRARY support required for full USABILITY.
9. Community Support:- Huge Python community support AVAILABLE for beginner, INTERMEDIATE AND ADVANCE level
PROGRAMMERS.
10. CBSE 10th STANDARD SYLLABUS HAS Pythonnow.
11. The growth AND ACCEPTANCE python HAS shown over the YEARS, is EXCEPTIONAL. Click Here for more DETAILS.
[References:-]
1. https://en.wikipediA.org/wiki/Python_(progrAmming_lAnguAge)
Python uses DYNAMIC typing AND A COMBINATION of reference counting AND A cycle-detecting GARBAGE collector for memory
MANAGEMENT. It ALSO FEATURES DYNAMIC NAME RESOLUTION(LATE binding) which binds methods AND VARIABLE NAMES during
PROGRAM execution.
As we know, whenever we run ANY APPLICATION it gets LOADED into RAM AND some memory gets ALLOCATED by OS for THAT
APPLICATION. Fig-1 shows the SAME. Now, Fig-2 shows the different AREA CREATED in the ALLOCATED memory for running the
APPLICATION.
Code AREA:- Fixed in size AND code gets LOADED in this AREA.
STACK AREA:- It MAY grow or shrink DYNAMICALLY AND is responsible for the order in which method will be resolved. Also in
this LOCAL VARIABLE reference ARE CREATED.
HEAP AREA:- This ALSO MAY grow or shrink DYNAMICALLY AND is responsible to store ANY object in Python. Here object get stored
in RANDOM order. Every object which gets stored here will HAVE A specific ID. GARBAGE collector runs in HEAP AREA from time to
time AND destroys the object which ARE not HAVING ANY reference.
VARIABLE AREA:- In This section VARIABLES ARE stored AND they refer their corresponding object in HEAP AREA.
Garbage Collection in Python
Different Flavours of Python
There ARE different FLAVOURS or IMPLEMENTATION of python ARE AVAILABLE. Out of which the most common ARE:-
1. Cpython:- C IMPLEMENTATION of Python, developed to run C APPLICATION on PVM, which WAS designed using C.
2. Jython:- JAVA IMPLEMENTATION of Python, developed to run JAVA APPLICATION on PVM, which WAS designed using JAVA.
3. PyPI:- Python IMPLEMENTATION of Python. Implements JIT compiler, to improve the PERFORMANCE ofpython APPLICATION.
4. Ruby Python:- Ruby IMPLEMENTATION of Python AND WAS developed to run the Ruby APPLICATION.
5. STACKLESS Python:- WAS developed to implement concurrency in Python.
6. ANACONDA Python:- WAS developed to HANDLE AND process the bigDATA.
Python supports AUTOMATIC GARBAGE collection. It uses A COMBINATION of reference counting AND cycle-detecting GARBAGE
collector for memory MANAGEMENT AN OPTIMISATION. gc module in python STANDS for GARBAGE collector which runs from
time to time AND which ever object’s reference count REACHES to zero, THAT gets GARBAGE collected AUTOMATICALLY. As A user
you ARE not ALLOWED to interfere in memory MANAGEMENT. It is TASK of the PVM to MANAGE the memory. Yes, but if you
WANT to check whether gc module is ENABLED or DISABLED or if you WANT to ENABLE or DISABLE it then you MAY use it like
below:-

Contenu connexe

Tendances

Transpilers(Source-to-Source Compilers)
Transpilers(Source-to-Source Compilers)Transpilers(Source-to-Source Compilers)
Transpilers(Source-to-Source Compilers)Shivang Bajaniya
 
Source-to-Source Compiler
Source-to-Source CompilerSource-to-Source Compiler
Source-to-Source CompilerMintoo Jakhmola
 
Turbo C Compiler Reports
Turbo C Compiler Reports Turbo C Compiler Reports
Turbo C Compiler Reports Sunil Kumar R
 
1.1 programming fundamentals
1.1 programming fundamentals1.1 programming fundamentals
1.1 programming fundamentalsJawad Khan
 
Introduction to compiler
Introduction to compilerIntroduction to compiler
Introduction to compilerAbha Damani
 
Lecture 1 Compiler design , computation
Lecture 1 Compiler design , computation Lecture 1 Compiler design , computation
Lecture 1 Compiler design , computation Rebaz Najeeb
 
Web programming UNIT II by Bhavsingh Maloth
Web programming UNIT II by Bhavsingh MalothWeb programming UNIT II by Bhavsingh Maloth
Web programming UNIT II by Bhavsingh MalothBhavsingh Maloth
 
Source vs object code
Source vs object codeSource vs object code
Source vs object codeSana Ullah
 
Chapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdfChapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdfDrIsikoIsaac
 
unit1pdf__2021_12_14_12_37_34.pdf
unit1pdf__2021_12_14_12_37_34.pdfunit1pdf__2021_12_14_12_37_34.pdf
unit1pdf__2021_12_14_12_37_34.pdfDrIsikoIsaac
 
Chapter One
Chapter OneChapter One
Chapter Onebolovv
 
basics of compiler design
basics of compiler designbasics of compiler design
basics of compiler designPreeti Katiyar
 
Pros and cons of c as a compiler language
  Pros and cons of c as a compiler language  Pros and cons of c as a compiler language
Pros and cons of c as a compiler languageAshok Raj
 

Tendances (19)

Introduction to c language
Introduction to c language Introduction to c language
Introduction to c language
 
Transpilers(Source-to-Source Compilers)
Transpilers(Source-to-Source Compilers)Transpilers(Source-to-Source Compilers)
Transpilers(Source-to-Source Compilers)
 
Source-to-Source Compiler
Source-to-Source CompilerSource-to-Source Compiler
Source-to-Source Compiler
 
Compiler type
Compiler typeCompiler type
Compiler type
 
Turbo C Compiler Reports
Turbo C Compiler Reports Turbo C Compiler Reports
Turbo C Compiler Reports
 
1.1 programming fundamentals
1.1 programming fundamentals1.1 programming fundamentals
1.1 programming fundamentals
 
LANGUAGE TRANSLATOR
LANGUAGE TRANSLATORLANGUAGE TRANSLATOR
LANGUAGE TRANSLATOR
 
Introduction to compiler
Introduction to compilerIntroduction to compiler
Introduction to compiler
 
Lecture 1 Compiler design , computation
Lecture 1 Compiler design , computation Lecture 1 Compiler design , computation
Lecture 1 Compiler design , computation
 
Language processor
Language processorLanguage processor
Language processor
 
Introduction of c language
Introduction of c languageIntroduction of c language
Introduction of c language
 
Embedded _c_
Embedded  _c_Embedded  _c_
Embedded _c_
 
Web programming UNIT II by Bhavsingh Maloth
Web programming UNIT II by Bhavsingh MalothWeb programming UNIT II by Bhavsingh Maloth
Web programming UNIT II by Bhavsingh Maloth
 
Source vs object code
Source vs object codeSource vs object code
Source vs object code
 
Chapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdfChapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdf
 
unit1pdf__2021_12_14_12_37_34.pdf
unit1pdf__2021_12_14_12_37_34.pdfunit1pdf__2021_12_14_12_37_34.pdf
unit1pdf__2021_12_14_12_37_34.pdf
 
Chapter One
Chapter OneChapter One
Chapter One
 
basics of compiler design
basics of compiler designbasics of compiler design
basics of compiler design
 
Pros and cons of c as a compiler language
  Pros and cons of c as a compiler language  Pros and cons of c as a compiler language
Pros and cons of c as a compiler language
 

Similaire à Python Introduction

Insight into progam execution ppt
Insight into progam execution pptInsight into progam execution ppt
Insight into progam execution pptKeerty Smile
 
PYTHON FEATURES.pptx
PYTHON FEATURES.pptxPYTHON FEATURES.pptx
PYTHON FEATURES.pptxMaheShiva
 
Programming 1: Compilers, Interpreters & Bytecode
Programming 1: Compilers, Interpreters & BytecodeProgramming 1: Compilers, Interpreters & Bytecode
Programming 1: Compilers, Interpreters & BytecodeRichard Homa
 
Introduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdfIntroduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdfVaibhavKumarSinghkal
 
Module1-Chapter1_ppt.pptx
Module1-Chapter1_ppt.pptxModule1-Chapter1_ppt.pptx
Module1-Chapter1_ppt.pptxSandeepR95
 
Chapter 2 Program language translation.pptx
Chapter 2 Program language translation.pptxChapter 2 Program language translation.pptx
Chapter 2 Program language translation.pptxdawod yimer
 
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfINTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfSubramanyambharathis
 
Compiler vs Interpreter-Compiler design ppt.
Compiler vs Interpreter-Compiler design ppt.Compiler vs Interpreter-Compiler design ppt.
Compiler vs Interpreter-Compiler design ppt.Md Hossen
 
LKGtoPG - Basics of C Language
LKGtoPG - Basics of  C LanguageLKGtoPG - Basics of  C Language
LKGtoPG - Basics of C Languagelkgtopg jobs
 
Compilers and interpreters
Compilers and interpretersCompilers and interpreters
Compilers and interpretersRAJU KATHI
 
COMPUTER ORGANIZATION.pptxbkobuujghuujjj
COMPUTER ORGANIZATION.pptxbkobuujghuujjjCOMPUTER ORGANIZATION.pptxbkobuujghuujjj
COMPUTER ORGANIZATION.pptxbkobuujghuujjjAnujyotiDe
 
Language processing system.pdf
Language processing system.pdfLanguage processing system.pdf
Language processing system.pdfRakibRahman19
 
MikroBasic
MikroBasicMikroBasic
MikroBasicbutest
 
MikroBasic
MikroBasicMikroBasic
MikroBasicbutest
 
MikroBasic
MikroBasicMikroBasic
MikroBasicbutest
 
MikroBasic
MikroBasicMikroBasic
MikroBasicbutest
 

Similaire à Python Introduction (20)

Python introduction
Python introductionPython introduction
Python introduction
 
Insight into progam execution ppt
Insight into progam execution pptInsight into progam execution ppt
Insight into progam execution ppt
 
python unit2.pptx
python unit2.pptxpython unit2.pptx
python unit2.pptx
 
PYTHON FEATURES.pptx
PYTHON FEATURES.pptxPYTHON FEATURES.pptx
PYTHON FEATURES.pptx
 
Chapter1.pdf
Chapter1.pdfChapter1.pdf
Chapter1.pdf
 
Programming 1: Compilers, Interpreters & Bytecode
Programming 1: Compilers, Interpreters & BytecodeProgramming 1: Compilers, Interpreters & Bytecode
Programming 1: Compilers, Interpreters & Bytecode
 
Introduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdfIntroduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdf
 
Module1-Chapter1_ppt.pptx
Module1-Chapter1_ppt.pptxModule1-Chapter1_ppt.pptx
Module1-Chapter1_ppt.pptx
 
Pi Is For Python
Pi Is For PythonPi Is For Python
Pi Is For Python
 
Chapter 2 Program language translation.pptx
Chapter 2 Program language translation.pptxChapter 2 Program language translation.pptx
Chapter 2 Program language translation.pptx
 
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfINTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
 
Compiler vs Interpreter-Compiler design ppt.
Compiler vs Interpreter-Compiler design ppt.Compiler vs Interpreter-Compiler design ppt.
Compiler vs Interpreter-Compiler design ppt.
 
LKGtoPG - Basics of C Language
LKGtoPG - Basics of  C LanguageLKGtoPG - Basics of  C Language
LKGtoPG - Basics of C Language
 
Compilers and interpreters
Compilers and interpretersCompilers and interpreters
Compilers and interpreters
 
COMPUTER ORGANIZATION.pptxbkobuujghuujjj
COMPUTER ORGANIZATION.pptxbkobuujghuujjjCOMPUTER ORGANIZATION.pptxbkobuujghuujjj
COMPUTER ORGANIZATION.pptxbkobuujghuujjj
 
Language processing system.pdf
Language processing system.pdfLanguage processing system.pdf
Language processing system.pdf
 
MikroBasic
MikroBasicMikroBasic
MikroBasic
 
MikroBasic
MikroBasicMikroBasic
MikroBasic
 
MikroBasic
MikroBasicMikroBasic
MikroBasic
 
MikroBasic
MikroBasicMikroBasic
MikroBasic
 

Plus de Learnbay Datascience

Artificial Intelligence- Neural Networks
Artificial Intelligence- Neural NetworksArtificial Intelligence- Neural Networks
Artificial Intelligence- Neural NetworksLearnbay Datascience
 
Artificial intelligence - expert systems
 Artificial intelligence - expert systems Artificial intelligence - expert systems
Artificial intelligence - expert systemsLearnbay Datascience
 
Artificial intelligence - research areas
Artificial intelligence - research areasArtificial intelligence - research areas
Artificial intelligence - research areasLearnbay Datascience
 
Artificial intelligence intelligent systems
Artificial intelligence   intelligent systemsArtificial intelligence   intelligent systems
Artificial intelligence intelligent systemsLearnbay Datascience
 

Plus de Learnbay Datascience (20)

Top data science projects
Top data science projectsTop data science projects
Top data science projects
 
Python my SQL - create table
Python my SQL - create tablePython my SQL - create table
Python my SQL - create table
 
Python my SQL - create database
Python my SQL - create databasePython my SQL - create database
Python my SQL - create database
 
Python my sql database connection
Python my sql   database connectionPython my sql   database connection
Python my sql database connection
 
Python - mySOL
Python - mySOLPython - mySOL
Python - mySOL
 
AI - Issues and Terminology
AI - Issues and TerminologyAI - Issues and Terminology
AI - Issues and Terminology
 
AI - Fuzzy Logic Systems
AI - Fuzzy Logic SystemsAI - Fuzzy Logic Systems
AI - Fuzzy Logic Systems
 
AI - working of an ns
AI - working of an nsAI - working of an ns
AI - working of an ns
 
Artificial Intelligence- Neural Networks
Artificial Intelligence- Neural NetworksArtificial Intelligence- Neural Networks
Artificial Intelligence- Neural Networks
 
AI - Robotics
AI - RoboticsAI - Robotics
AI - Robotics
 
Applications of expert system
Applications of expert systemApplications of expert system
Applications of expert system
 
Components of expert systems
Components of expert systemsComponents of expert systems
Components of expert systems
 
Artificial intelligence - expert systems
 Artificial intelligence - expert systems Artificial intelligence - expert systems
Artificial intelligence - expert systems
 
AI - natural language processing
AI - natural language processingAI - natural language processing
AI - natural language processing
 
Ai popular search algorithms
Ai   popular search algorithmsAi   popular search algorithms
Ai popular search algorithms
 
AI - Agents & Environments
AI - Agents & EnvironmentsAI - Agents & Environments
AI - Agents & Environments
 
Artificial intelligence - research areas
Artificial intelligence - research areasArtificial intelligence - research areas
Artificial intelligence - research areas
 
Artificial intelligence composed
Artificial intelligence composedArtificial intelligence composed
Artificial intelligence composed
 
Artificial intelligence intelligent systems
Artificial intelligence   intelligent systemsArtificial intelligence   intelligent systems
Artificial intelligence intelligent systems
 
Applications of ai
Applications of aiApplications of ai
Applications of ai
 

Dernier

On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 

Dernier (20)

On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 

Python Introduction

  • 1. Anaconda Installation:- What is Programming Language and Operating System and why do we need them? A brief introduction to computer memory Types of Programming Languages There ARE MAINLY two types of PROGRAMMING LANGUAGE. 1. Low Level PROGRAMMING LANGUAGE I. MACHINE Level LANGUAGE or BINARY Code II. Assembly LANGUAGE 2. High Level PROGRAMMING LANGUAGE I. BASED on purpose i. GENERAL Purpose PL ii. SPECIAL Purpose PL II. BASED on converters used i. Compiled —> C/C++/JAVA/PYTHON ii. Interpreted —> PERL/JAVA Script/Python There ARE MAINLY two types of memory in computer:- 1. VOLATILE Memory - PRIMARY Memory - TEMPORARY STORAGE - RAM, CACHE, Register 2. NON-VOLATILE memory - SECONDARY Memory - PERMANENT STORAGE - HDD, SDD, Floppy, CD, Pen Drive -> Every PROGRAM runs into RAM. -> SECONDARY memory ARE used for PERMANENT STORAGE. A PROGRAMMING LANGUAGE is A set of predefined words thAt Are combined into A progrAm According to predefined RULES(SYNTAX). PROGRAMMING LANGUAGES ARE used to develop the APPLICATION which helps in turn to get our TASK done. An OPERATING System is A SOFTWARE THAT ALLOWS A user to run other APPLICATIONS on A computing device. The MAIN job of OPERATING system is to MANAGE computer’s SOFTWARE AND HARDWARE resources like I/O device, Network device, STORAGE device etc. AND to run the APPLICATION on our system AND resource ALLOCATION required for the SAME. 1. HTTPS://WWW.ANACONDA.COM/PRODUCTS/INDIVIDUAL 2. HTTPS://REPO.ANACONDA.COM/ARCHIVE/
  • 2. Sl No Low Level Programming Language High Level Programming Language 1 More closer towards system, less closer towards user More closer towards user, less closer towards system 2 Need to know the underlying architecture of machine on which you are coding No need to know the underlying architecture of machine on which you are coding 3 Bit complex to learn and write the code, not manageable when program grows and not ideal to develop large application Easy to learn and write the code, easily manageable when program grows and ideal to develop large application 4 As a programmer you need to manage the memory and handle the security issues in your program Compiler or VM is responsible to manage the memory and handle the security issues your program 5 Code is not portable. Code is portable. 6 Not expressive Expressive 7 e.g. Machine code, Assembly code e.g. C, C++, Java, Python etc 8 Sample code Sample code What is Source code, Byte code and Machine code in Python? Type of Errors in Python:- Source Code:- The code, written to develop the APPLICATION. In python, (.-)file is source code. Byte code:- A fixed set of instructions THAT represents ALL OPERATIONS like ARITHMETIC, COMPARISON, memory RELATED OPERATIONS etc. The code GENERATED AFTER the COMPILATION of source code. (.pyc) file is byte code. Byte code is system AND PLATFORM independent. It is ALSO CALLED p-code, PORTABLE code or object code. PVM:- STANDS for Python VIRTUAL MACHINE AND is A SOFTWARE which comes with Python. PVM comes with Interpreter. MACHINE code:- The code GENERATED AFTER INTERPRETATION of byte code. It is system AND PLATFORM dependent.
  • 3. Compiled Languages vs Interpreted Languages Why do we need translator? Computer's HARDWARE ARE electronic devices AND they CAN not UNDERSTAND HUMAN LANGUAGE, RATHER they COMMUNICATE with EACH other with the help of SIGNALS. SIGNALS Are nothing but BINARY code And is completely low level LANGUAGE. To TRANSLATE High level lAnguAges in humAn reAdAble formAt to mAchine reAdAble formAt(binAry code), we need TRANSLATORS. I.Compiled LANGUAGES needs compiler to TRANSLATE the code whereAs Interpreted LANGUAGES needs interpreter to TRANSLATE the code from one form toANOTHER. II. Compiler & Interpreter both ARE TRANSLATOR AND ARE computerPROGRAMS. III. Compiler TRANSLATES the whole code from one form to Another form ALL AT once while interpreter is instruction by instruction execution. IV. In Python, Compiler is used to trAnslAte Source code to byte code whereAs Interpreter is used to TRANSLATE the Byte code to MACHINE code. V. All SYNTACTICAL errors Are cAught AtCOMPILATION stAge in Python whereAs All run time errors Are cAught AT INTERPRETATION STAGE. NOTE:- ORIGINALLY, Python is Interpreted LANGUAGE. But over the time, Python is MADE compiled AND Interpreted both AS python HAS ESTABLISHED itself AS full fledged PROGRAMMING LANGUAGE AND is ACCEPTABLE ACROSS wide AREA of APPLICATION. [References:-] 1. https://en.wikipediA.org/wiki/Interpreted_lAnguAge 2. https://www.freecodecAmp.org/news/compiled-versus-interpreted-lAnguAges/ Error HANDLING is one of the most IMPORTANT FEATURE of Python. It WAS MAIN deciding FACTOR in development of Python. There ARE MAINLY two type of errors in Python:- I. SYNTAX Error CAUGHT AT COMPILATION STAGE II. Run-time Error CAUGHT AT run time or INTERPRETATION STAGE. SYNTAX & SYNTACTICAL Errors:- Every PROGRAMMING LANGUAGE comes with A set of rules which defines THAT how the codes will be written AND interpreted or compiled. These set of rules ARE CALLED SYNTAX. Not following the rules MAY LEAD to errors which ARE CALLED SyntAx errors. In Python, AT COMPILATION STAGE we check for the SYNTAX errors. If there ARE no SYNTAX errors in your PROGRAM then it will be compiled successfully AND byte code will be GENERATED. If there ARE some SYNTAX error in your PROGRAM then COMPILATION will not HAPPEN AND byte code will not be GENERATED. SYNTAX Error HAPPENS when Python CAN’T UNDERSTAND WHAT you ARE SAYING. Run Time Errors:- Run time error HAPPENS when Python CAN UNDERSTAND WHAT you ARE SAYING but runs into problem while running your instructions. To find the list of ALL run time error you MAY execute the below code:- >>> print(dir(“__builtins__”)) We CAN HANDLE runtime errors using exception HANDLING concept in Python unlike SYNTAX errors which HAS to be rectified before COMPILATION. Run time errors MAY CAUSE PARTIAL IMPLEMENTATION of your code. [Reference:-] 1. https://cscircles.cemc.uwAterloo.cA/1e-errors/
  • 4. Why do we need Byte code? Why Python is compiled and interpreted both? Can’t we make it either compiled or interpreted? What is Python? What is Python?Python is GENERAL purpose, High level PROGRAMMING LANGUAGE. TRADITIONAL PROGRAMMING LANGUAGES like C or C++ were compiled LANGUAGES. If you execute ANY source code in C or C++, it first CREATES AN EXECUTABLE file which is PLATFORM dependent AND then you run this file to get the output on THAT PARTICULAR PLATFORM. Source Code —> Compiler —> EXECUTABLE Code(.exe file) —> Output You CAN see here THAT the INTERMEDIATE code which ARE GENERATED is not PLATFORM independent. But remember THAT the Source code written in these LANGUAGES ARE PORTABLE. So, to counter this problem, LANGUAGES like JAVA And Python were developed which Are first compiled to object code or Byte code or P-CODE(PORTABLE code). These object codes ARE completely PLATFORM independent. Now when you move this object code to other PLATFORM then you need to TRANSLATE it to MACHINE code. For TRANSLATION AT this STAGE, you MAY either use compiler or interpreter, ANY TRANSLATOR which AGAIN TRANSLATES the byte code to MACHINE code. For INSTANCE, JAVA, PyPI, JPython uses JIT compiler, where CPython uses interpreter. Source Code —> Compiler —> Byte Code —> Interpreter or JIT compiler(PVM/JVM) —> MACHINE Code —> Output So BASICALLY, we MAY SAY THAT to bridge the GAP between PORTABLE PROGRAMMING LANGUAGES AND PLATFORM independent PROGRAMMING LANGUAGES we CAME up with this IDEA to HAVE two TRANSLATORS. First time it is used to GENERATE SHIPPABLE code AND second time it is used to convert the byte code to MACHINE code. [References:-] 1. https://en.wikipediA.org/wiki/Python_(progrAmming_lAnguAge) 2. https://www.geeksforgeeks.org/history-of-python/ 3. http://effbot.org/pyfAq/why-wAs-python-creAted-in-the-first-plAce.htm 4. https://www.ArtimA.com/intv/python.html Byte code ARE ALSO CALLED object code or p-code or PORTABLE code which MAY be be directly shipped to your client. As well AS it is PLATFORM independent so it CAN run on ANY PLATFORM. Which MAKES service provider's AND developer's life EASY AS they do not HAVE to write the code for the SAME APPLICATION to be used on different PLATFORM.
  • 5. What are some good features of Python? 1. Simple & EASY to LEARN:- Python is one of the simplest LANGUAGE ever. SYNTAXES ARE simple, EASY to remember AND quite expressive. When it comes to LEARNING, it HAS been found THAT the LEARNING curve for python is quite steeper COMPARED to other PROGRAMMING LANGUAGES. SAMPLe ProgrAm in JAVa to ADd two numbers:- public CLASS ADD{ public STATIC void MAIN(STRING[]ARGS){ int A = 10; int b = 20; int c = A+B; System.out.println(c); } } SAMPLe ProgrAm in Python to ADd two numbers:- A = 10 b = 20 c = A+B print(c) 2. Most expressive LANGUAGE:- Being one of the most expressive LANGUAGE is EASY to write the code in fewer lines, which LEADS to less cluttered PROGRAM, FASTER execution AND EASY to debug AND MAINTAIN. 3. FREEWARE AND open source:- Python being FREEWARE, you don’t HAVE to spend on licensing. And since it is open source so its ORIGINAL source code is freely AVAILABLE AND CAN be redistributed AND MODIFIABLE. 4. Compiled AND Interpreted both:- ORIGINALLY, Python WAS developed to bridge the GAP between C AND shell scripting AND ALSO include the FEATURE of exception HANDLING from ABC LANGUAGE. So we CAN SAY THAT, INITIALLY Python WAS interpreted LANGUAGE. But LATER it WAS MADE compiled AND interpreted both. GENERALLY, the steps involved in execution of ANY python PROGRAM ARE -
  • 6. Memory Management in Python:- In the ABOVE DIAGRAM, compiler is responsible to compile the source code. In the COMPILATION STAGE ALL the SYNTACTICAL errors ARE checked WHEREAS interpreter is responsible to interpret the byte code AND check the run time error in this STAGE. Compiler AND interpreter both ARE TRANSLATOR. Compiler TRANSLATES the source code to byte code(.pyc file) ALL AT once WHEREAS interpreter TRANSLATES byte code to mAchine code one instruction At A time which interActs with HARDWARE to give the FINAL output. Few IMPORTANt commAnds:- 1. python FILE_NAME.PY —> To run the file 2. python -m py_compile FILE_NAME.PY —> To compile the file 3. python -m dis FILE_NAME.PY —> To see the byte code. 4. python FILE_NAME.CPYTHON-38.PYC —> To run the compiled code. 5. PORTABLE AND PLATFORM Independent:- Python is portAble And plAtform independent both. Source code is PORTABLE WHEREAS byte code(.pyc file) is PLATFORM independent. C is PORTABLE but not PLATFORM independent. 6. DYNAMICALLY typed PROGRAMMING LANGUAGE:- In python, everything is AN object. Objects get stored in the HEAP AREA AND it’s memory ADDRESS is referenced by the VARIABLE or NAME with which it is binded. Unlike other PROGRAMMING LANGUAGES, In python, memory LOCATION does not work like A CONTAINER RATHER it works on reference model. No need to specify the DATA type explicitly in python. 7. Extensible AND Embedded both - Extensibility - Extending the code from other PROGRAMMING LANGUAGES into Python code. Embedded - Embedding Python code to other PROGRAMMING LANGUAGES code. 8. BATTERIES included:- Python comes with huge LIBRARY support required for full USABILITY. 9. Community Support:- Huge Python community support AVAILABLE for beginner, INTERMEDIATE AND ADVANCE level PROGRAMMERS. 10. CBSE 10th STANDARD SYLLABUS HAS Pythonnow. 11. The growth AND ACCEPTANCE python HAS shown over the YEARS, is EXCEPTIONAL. Click Here for more DETAILS. [References:-] 1. https://en.wikipediA.org/wiki/Python_(progrAmming_lAnguAge)
  • 7. Python uses DYNAMIC typing AND A COMBINATION of reference counting AND A cycle-detecting GARBAGE collector for memory MANAGEMENT. It ALSO FEATURES DYNAMIC NAME RESOLUTION(LATE binding) which binds methods AND VARIABLE NAMES during PROGRAM execution. As we know, whenever we run ANY APPLICATION it gets LOADED into RAM AND some memory gets ALLOCATED by OS for THAT APPLICATION. Fig-1 shows the SAME. Now, Fig-2 shows the different AREA CREATED in the ALLOCATED memory for running the APPLICATION. Code AREA:- Fixed in size AND code gets LOADED in this AREA. STACK AREA:- It MAY grow or shrink DYNAMICALLY AND is responsible for the order in which method will be resolved. Also in this LOCAL VARIABLE reference ARE CREATED. HEAP AREA:- This ALSO MAY grow or shrink DYNAMICALLY AND is responsible to store ANY object in Python. Here object get stored in RANDOM order. Every object which gets stored here will HAVE A specific ID. GARBAGE collector runs in HEAP AREA from time to time AND destroys the object which ARE not HAVING ANY reference. VARIABLE AREA:- In This section VARIABLES ARE stored AND they refer their corresponding object in HEAP AREA.
  • 8. Garbage Collection in Python Different Flavours of Python There ARE different FLAVOURS or IMPLEMENTATION of python ARE AVAILABLE. Out of which the most common ARE:- 1. Cpython:- C IMPLEMENTATION of Python, developed to run C APPLICATION on PVM, which WAS designed using C. 2. Jython:- JAVA IMPLEMENTATION of Python, developed to run JAVA APPLICATION on PVM, which WAS designed using JAVA. 3. PyPI:- Python IMPLEMENTATION of Python. Implements JIT compiler, to improve the PERFORMANCE ofpython APPLICATION. 4. Ruby Python:- Ruby IMPLEMENTATION of Python AND WAS developed to run the Ruby APPLICATION. 5. STACKLESS Python:- WAS developed to implement concurrency in Python. 6. ANACONDA Python:- WAS developed to HANDLE AND process the bigDATA. Python supports AUTOMATIC GARBAGE collection. It uses A COMBINATION of reference counting AND cycle-detecting GARBAGE collector for memory MANAGEMENT AN OPTIMISATION. gc module in python STANDS for GARBAGE collector which runs from time to time AND which ever object’s reference count REACHES to zero, THAT gets GARBAGE collected AUTOMATICALLY. As A user you ARE not ALLOWED to interfere in memory MANAGEMENT. It is TASK of the PVM to MANAGE the memory. Yes, but if you WANT to check whether gc module is ENABLED or DISABLED or if you WANT to ENABLE or DISABLE it then you MAY use it like below:-