0 ratings 0% found this document useful (0 votes) 47 views 37 pages Python Exercise
The document provides an overview of Python, detailing its history, features, limitations, and applications across various fields such as web development, data science, and machine learning. It discusses Python's evolution from its inception in 1989 by Guido Van Rossum to its current versions, highlighting its interpreted nature, ease of use, and extensive libraries. Additionally, it outlines the programming cycle, classification of programming languages, and the installation process for Python.
AI-enhanced title and description
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here .
Available Formats
Download as PDF or read online on Scribd
Carousel Previous Carousel Next
Save python exercise For Later 1
(Introduction)
© Brief History © Editing Python Files
'@ Python Version Python Documentation
‘Installing Python © Getting Help
@ Environment Variable @ Dynamic Types
'@ Executing Python from Command Line @ Reserved Word
@ IDLE Naming Conventions
@ Python
Python UF high level 74 interpreted programming language @; WF A 1989 ¥ Guido Van
Rossum BRT develop A 7 7 TIT AL AT 1991 F release WE Mi otomeET We Te
programming language @& WH software development 74 web development % fer aA Tear waa
Bi
Python # Fa @ Version @—Python 2 Wa Python 3 7 BH H sa B facet set AL
‘APIA Python file 7 extension py Wat @ 7M Command * Awe a A ey Ae Ho
STAPH Brun HC AHA
Pra sf Python Program 7 Prefatad aA wR S run He AHA F—
1, Interactive Interprefer BRT
¢ from command line % BRT
ated Development Environment (IDLE) % &RT
firm : Interpreting a High Level Language
Features of Python
1. Python TG high level language @; W free FM open sor
eth
Jangu2 | wg statin afm creer
6
= ¥ interpreted language @ 47 Python program 8M interpreter BRT execute FHA
i
Python program ® Sat & TAM HW AHA Fl AM LAA Syntax FAT Structure simple
‘Ti clearly defined ®t 81
Python case sensitive programming language @ Aq PROGRAM 4 program 2
reams Fi
Python, portable 74 plateform independent 1 aaiq ze fate amitfen fen wa
wean eer 1 srart & run Fe aA th
Python 4 aa Fie Predefined library functions SII @1
7. Python web development # aga STH @1
8. Python 4 FS TAM Fa Nested TAM fee % faz indentation A FAM fe TIT
9. Python, Feet Bifrafer F% TAl Fa Machine learning, 10T NLP ne
10.
implementation @] 4G Svat @1
Python @% eT BW Commercial database @ interface FAA ET @
Limitations/Disadvantage of Python
cd
language fT FF @ Enterprise solution ane % fay aga Sent Wt wae Fe
limitations Free ¢—
Difficulty in using other language ; Python 7 JF FA AA programmer W FIA
library 4 features @ familiar @ WA @, FF ZA programming languages TW AA
wa A aren TF tt
Weak in Mobile Computing : Python language PH ¥ mobile computing application
% fer aga Sent A
Gets Slow in Speed : Python # 3H compiler AAT interpreter ® FEZ A exicute
Wa @, faa program execution slow @ Wa & aa Ft-H AF web application #
fast arm @1
Run Time Error : Python U dynamically typed Sonf Gera @, fea AE run time
error show EI @1
Data Base Access : 372 StnfT GIF Java, IDBL, ODBC F FAT F FAH limited data
base access @mt @1
Memory Consumption : Python, memory intensive task % few aga sear freed At
Wa @ Python ¥ FTI memory 7 consumption #a @
Applications of Python
Python 1% general purpose programming language @, FRA AA Bk syFIM ti Fo we
Applica
tions Prevaa @—
1, Web Development : 4 Web application develop * * fat sf Python A Fam FT
@ @ Tae AEA AE predefined library SI @ FRA Azz @ HTML, XML, JSOD
nail, Intemet Protocol #7 aTart @ handle PFA HW BFA Bi Python # Python Wiki
ines, POCOO, Python Blog Software FF FEAT developments @aftaa | 3
2. Data Sclence : 374 % 2 9 Wel AeA AMT data FW process FA a , Python F
Sree HEAT library FFT Data Si Fae aga A sem faa HH ti faa
Numpy, Pands Ta Matplotlib FS Weerpi va SAH library BM fT FA data
isualization Safe A sah & tesa A Tat
}. Machine Learning : Machine learning Python 1 U% ACA @ AeTT! application @
Python #% Sy library FW Scikit-lean, Tensorflow Ta NLTK tf A WIT machine
leaming @] Agata Su a fea we 1 fay AT STF Automation, Al, Medical
diagnosis, Sales Analysis onf@ 3 spr #1
4. Image Processing : Image processing % application, face recognition, activity tracking
anfe % open cv library 7 FMT FHA FAT Fi Python, Image processing * fay AeA
popular ®1 Vpython, Gogh, imgseck 7] application #1
5. Game Development : Game development % fat 4 Phyton #1 Wa H WB Pygame
library FA STS TAH few wi FH ae @ Android mobile # games development *
fama, Python 7 warm Bw
. Embedded System and 10T : 4 %f Python 7 AH application @ FR wT 7H aT
product automation, robotics, 1OT 31f& 7 develop FA A python Aa A sSrIrh @
Micropython, Python 7 W light version @, 3H Microcontroller programing * fe
fay ea 8 wT TT BI
1 see aks oe : Android Apps 7 development fat ®4 @ Android SDK * ATA A
‘APRA python % AMAR A FT Android App FW develop A AFA @,
fret fer, Pythoris Kivy library 1 7am fren Set
. Selentifie and Numerical Application ; Python 71 aM Scientific T Numerical
Computing % fea fT FA Bi Scipy, Pondas, Ipython, Numeric Python 3YB library
@, Hl Engineering Ta Science * application development 4 FAM FHA Ba @
9. Business Applications : Python ® 34M % AeA A FA ERP, e-commerce systems Itz
7 develop FA @
10, 3D CAB Application : 3D CAD Application #1 develop FA * fee Fandango 7 a
fra arm 81
cleaning,
2
lm Process of Programming
Step 1: Problem 26 define eT Fat model eT: FATIH PHA AAT A define FAT AA
‘SAF Modeling FHF
Step 2 : Problem 2 logical solution wet AAT : Logical solution TW clear, finite 7
step-by-step procedure @ Prat AAEM A a FA AT
FA GF Algorithm Hea @ Fa fT HT B we HAF fora A flow chart A aT Hea
‘Tere % ae, wee fore MEG A BA aT AIM & sik TUM BA TH google TAH AWA t
@ FH FAA finite solution fet WAM FA ALT H SA step We TM clear WA aed4 | weg sini afm crear
Step 3: Wray ferert : Programing : “4% step ¥ 7 algorithm A TF working code #
uftatda Fa @, fara computer MAM 4 AAR TH st SHH fe BH Hera Aa @ Programming
language 7%, faa FH Program ferarn tat #1
Programing Cycle of Python
1. Write your program or edit your program,
2. Run your program on an input
3. If output is not correct, return to coding step (step 1)
4. Repeat step 2, 3 for other inputs if any.
@ Classification of Programming Language
Programming language, ft * computer F fz (instruction) 73 AW WH AIH 81H FT
syntactic 74 Semantic Frat we seafta @1 Aer sear A afr A ae Computer
Programming Languages 74M 4 are art 81 Se TAA aA soe sree fanaa faa are ti
Tah qa a ea e—
1. Machine language 5. Scripting language
2. Assembly language 6. Domain Specific language
3. High level language 7. Glue language
4. System language
Machine Language : 54 lowest level 74 First Generation Programming language * 71 @
FAT Fa @) Fa AS FH Programming language ¥ aa a wa Wet @—True Ti False TafeTT Fa
ry Programming language % 7 @ “t FM Fat @1 Computer # A instructions F 0 Ta 1
B08 A vie fra ae FI ae Machi language BAe # HEA tet
Assembly Language : 74 middle level language 44 Second Generation language * 1 @
FT BT 81 FAK FAA (instructions) Machine language WWE @ Ha F Ta instruction TH
variable % specific WH #a ti fF TA command Hea G1 Fae Hee A cared aan aA * few
‘Fe symbols FAT Pa area B
FAH FU machine instruction % fA TH statement fea Wat 1 wa Ata HA few
register allocation, call, stack, timer, jump, loop Snf@ 3 34r1 frat stat Boftaa |S
Computer 7 assembly language 7 FAA % fer, WH Assember A sare Tat th
assembly instruction 4 machine instruction 4 Wtafaa FM Bl Assembler Wh BITAT Te F
oror00}00
Lona ‘oot
Add 1000110001
‘Store
source Aseny Binary Machine
incton incon
fra : Assembler
{sseeetr J—-{_urner_ J —~(
file
fra: Assembler and Linker
High Level Language : Wi WR 7 High Level Language (HLL), procedure oriented
language 7 machine independent @t €1 7 upper language 74 third generation language * 7A
BF wt at BAe FF program 7 AAT English language fA, Mathematical Ta 34 fart
2H wa HA A fae eM He Ai favre store, AMAA redable WaT AAAY Bea Hen 1 A 3
A Computer FARA % fee FI Machine instruction 4 translate FAT Wa 1 FAH for a OF
atreara HF arava At @1 fF compiler 7 interpreter FEA i TA compiler TA translator FT
WA FF source WE A machine understandable code F Urata FN Ba Bi
Comite) oor
{rm : Compiler and interpreter
‘FAIA : FORTRAN, Pascal, C, C++, Java, ADA, COBOL, LISP, Prolog ete.
‘System Language : System Programming * fe ®4 system programming language #1 7a"
ea aM SAA AAA A System s/w FMT Wea BI
FAM: PL, D, Rust, Swift
Seripling Language : 7% Tt progranming language ®t @ it FA programming language 4
communicate FA % fet design 7 Aa 1 FH extremly high level FM powerfull language
‘Hat @1 Fa Java Script, VB Script, PHP, Port Python, Rubly, ASP and TCC.
Domain Specific Language : 4 programming languauge Pret faa Ard AH YT WAH AH A
amet @1 FA CSS, Ant, SQL MFR
Glue Language : Glue language 74 programming language @ W ZAt BIT component F
FHT A manage FAW Be Het Bi6 | omer sinfin afm cae
We TA sw 7 program 7 integrate FA AW Arh Het tH fafa sm sas aT
waren 7 farafaa fH4 74 Ba BA interconnecting F support FA #1
Glue programming language, W22TEY environment 4 aga Sear Alaa Bet @, wer fate
AR F software BUF framework FT WA Ne B
‘FACCT: VBCript, Ruby, Python, Perl and PHP
Source code
Processor,
fra : Compiler Vs Interpreter
Source code Virtual machine
Processor
firm : Bite Compile code
1.1 History of Python
Python, F_ 1980 % ATM Guido Van Rossum BRI develop % TH 4 fH Netherland 7
“National Research Institute for Mathematics and Computer Science” Warreren # farfaa fren 3a
m1
Python 4 Fae stmfeT rag FI ABS Modula-3, C, C++, Afgol, Unix Shell 3nf& @ derive
fra ra tioftaa | 7
Python, copyrighted @1 Python 71 source code GNU General Public Licence (GPL) 3044
fare Sar H Bye F
Python ait ff wa Ax yo grT maintain F at & FM Guido Van Rossum at Ft TAA
progress #1 Sraeaz Wea @ ae ae safer SH ora eer @
FAS 1994 F Python 1,0 F FWA (release) FFA TA A AA AZ 2000 F Python 2.0 A We
(release) FFA 7A M1 Python 2.7.11 314 Python 2.0 A FAS FAA version F
AA 2000 F Python 3.0 7A A PreT TT AT FAA AAATA version Python 3.5.1 a Bye BI
Python 3, Python 2 @ stem1-3te Python version 81
Evaluation of Python
1972, [Le] _ Demisratcnie
1983 B Jame Strounstrup
1969 [Python] Guido Van Rossum
1901 [oak] James Gosting
Sun Microsystem
005 [Bava] “tow Ova)
2000 [c#] —_Microson
@ Why Python
Python U7 General purpose programming language @1 St FAA: scripting % fer, wim FH art
@1 FF object oriented scripting language FE We BF oop F concent F support WA BH
Python codefile % program 3 747 Script 8 Ie 2
Python % @@aq @ CMT features WAH ARM HM va wi A APT wea ti aH HS
arene a rere &, at sie A oaratta a a
1. Simple and Easy to learn 6. Extendable
2. Interpreted and Interactive 7. Dynamic
3. Object Oriented 8. GUI Programming and Data Bases
4. Portable 9. Board Standard Library
5. Scalable
‘FAI-AAT TW Python software F update PRA He Bi aM Fs Fant TH Hs 77 features F
WFAA TAT version BA Pa AaB8 | ome stain afm greet
Python #1 Ye version Python 1.0 V, Jan 1994 4 Bt fa TT AM FAH AZ Oct. 2000 F
Python 2.0 V #1 Dec. 2008 4 Python 3.0 V A et fen wT MM AAA A Se Python FT
Python 3.9.0 Ua Python 2.7.18 @ 747 version #1
e—Python 3 % TH F (Python 2 4) Backward compatability 7 Wet @ Haig Python 2 7
Program Fe Wi @1 Python 3 4 FM run Fh
Python 3.9.0 05 Oct 2020
Python 3.8.6 23 Sept 2020
Python 3.8.5 20 July 2020
Python 3.8.4 13 July 2020
Python 3.8.3 13 May 2020
Python 3.8.2 24 Feb 2020
Python 3.8.1 18 Dec 2019
Python 3.8.0 14 Oct 2019
Python 3.7.0 24 June 2018
Python 3.6.0 23 Dee 2016
Python 3.0 03 Dec 2008
Python 2.7.18 20 April 2020
Python 2.7.17 19 Oct 2019
Python 2.7.16 (02 March 2019
30 April 2018
17 Dec 2016
04 July 2010
01 Oct 2008
19 Sept 2006
30 Nov 2004
16 Oct 2000
Flavors of Python
1. C Python : 2@ Python 7 Standard Flavor @1 $441 FAM C language Applications * faz
aati
2. Jython or Python : 4 HW: Java Applications % fw #1 7 Jum F run FAB
3. Iron Python : 4 C# 74 Net Platform % Fa" 8 Aa Bae
4.P,P JIT Compiler #14 FA F Ta PVM F See Sa BI
5. Ruby Python : 4% Ruby Platform % 44 ® fare aa @1
6. Anaconda Python : 4 24 FT @ large volume * data processing, machine learing 74
mathematical Calculation % fora a1 4 Great at @1aftea | 9
Where We Can Use Python
adr # Python 3 eer ae fe ar By wie ae
Python TF Cross platfi
For Developing Desktop Applications
For Developing Web Application
For Developing Database Appl
For Network Programming
For Developing Games
For Data Analysis Application
For Machine Learning Application
For Developing Artificial Intelligence Applications
For Intemal of Things (1OT) Application
For Image Processing and its Application
1.3 Installing Python
m programing language @| Haq 7 fd si Platform FA Windows,
Macox, Linux f@ % Sart B run Wet Bi AE free FM open source @
How to Install Python on Windows [Pycharm IDE]
PyCharm is a cross-platform editor developed by JetBrains, Pycharm provides all the tools you
need for productive Python developmen, Below are the detailed steps for i
PyCharm,
talling Python and
I Installing Python
Step 1: To download and install Python visit the of ficial website of Python
hutp://www.python.org/downloads/and choose your version, We have chosen Python version
3.6.3
2 pythonra
10 | oeqex statin afr ore Lu
Step 2 : Once the download is complete, run the axe for install Python. Now click Ot ss
Now.
1B Pron 3.63 G2. 60 Setup = *
Install Python 3.6.3 (32-bit)
Selec install Now to instal Python with defaut settings or choose:
‘Customae to enable of 4
-— Customize installation
Choos location ond fates b
instal tauncher fora users (recommended)
wit Baa Pinon 36 to PATH (emma)
Step 3 : You can see Python installing at this point.
1B Pyren 38 G2 BO Sep
Setup Progress
Instabog:
re] Python 3.63 Standard Library (32-60)
—
R
python
windowsftea | 12
Step 4: When it finishes, you can see a screen that says the Setup was successful. Now click on
“Close”,
[i Pytnon 3.63 2-80 Sete
= Setup was successful
‘Specal thanks te Mark Hammon sathout whose years of
treety snared Windows expertise. Pytnon for Windows wot
Stil be Python for DOS.
[New to Python’ Start with the online tutorial and
sdoguneatatan,
‘See what's inthis reeane,
-—
© Disable pth ength mit
Chanpe as matheceepaon se prope icngsn t2
‘ar hae MONTE mae
python
windows b
1 Installing Pycharm
Step 1 : To download PyCharm visit the website
http://www jetbrains.convpycharm/download/and click the “DOWNLOAD” link under the
Community Section,
Download PyCharm
Windows» macos—Lnu
Professional Community
Full-featured IDE Lightweight IDE
for Python & Web for Python & Scientific
development development12 | wager sionfiin afm gras
Step 2: Once the download is complete, run the exe for install PyCharm, The stepup wizard
should have started. Click "Next".
BB PyCharm Community Edition Setup - x
Welcome to PyCharm Community
Edition Setup
Setup wl gade you through the station of PyCharm
Commurity ton.
{Ris recommended tht you dose al other appcatons
before staring Setup. Ths wl make it possible to uodate
‘reevant system flea without having © reboot you"
computer,
(ick Next to contrue.
Step 3: On the next screen, change the installation path ifrequired.
BB Py Charm Community Editon Setup = x
Choose install Location
(Choose the folder in which to stall PyCharm Community Edition.
‘Setup nl rata PyCharm Conmurnty Econ in the folowing folder. To natal na different
(elder, ick Browse and welect another flier. Ch Next to contre.
Space requred: 51908
Space avable: 62.708oftaa | 13
Step 4: On thenext screen, you can createa desktop shortcut if you want and click on "Next",
1B PyCham Community Eaton Setup =o x
Step 5 : Choose the start menu folder. Keep selected Jet Brains and click on "Install
PyCharm Community Edition Setup,
(Choose Start Menus Folder
‘Choose a Start Men folder for the PyCharm Community
Sate te St mara erm ch you mn create te program ser. You
‘can aco enter arame to create a new folder14 | weer sini afm gree
Step 6: Wait for the installation t
BB PyCharm Community Edition Setup =
natating
lense watt whe PyCharm Commurity Editon is beng insted.
ish.
Step 7 : Once installation finished, you should receive a message screen that PyCharm is
installed. If you want to go ahead and run it, click the "Run PyCharm Community Edition" box first
and click "Finish".
[BB PyCharm Community Edition Setup - Oouftaa | 15
Step 8 : After you click on "Finish", the Following screen will appear.
veces to rycnamm = Fs
a
PyCharm
Catt hee Peet
mom
cect ot em Vern Contd
© centage + Gatiiy »
1.4 Environment Variable
1, |PYTHONPATH — | PATH % BAR @ Bat @1 Fe aaa @ FF Interpereter 7 HAA A import
#1 wat module file A FE locate AZ PYTHONPATH *Hi-%
Python installer BRT ft weqa fn ara #1
PYTHONSTARTUR|4@ 3a file % path % Tam Fi Python Source FZ A initilize Fea
| Ha At interpreter start at @, TA AE execute Wa tI 7
PYTHONPATH #1 modify 7 utilities #1 GE AA Flcommand 3]
aa waa ti
3. |PYTHONCASEOK |2@ imported statement 4 first case insensitive match % f@@ Python 7
Prater FM #1 FA activate FA * farm wa FH HH value F ATA set Pra
israt @1
4. |PYTHONHOME — |® Search Path fe @, Gt PYTHONSTARTUR 2 PYTHONPATH
[# embedded at #1