0 ratings 0% found this document useful (0 votes) 3 views 11 pages Unit 1 - Python
The document provides an overview of Python programming, discussing its history, features, and syntax. It covers topics such as data types, functions, and the programming cycle, emphasizing Python's ease of use and flexibility. Additionally, it includes examples of code and explanations of various programming concepts within Python.
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
Go to previous items Go to next items
Mo
: Pufhon ix cr dimpofe one foowenpaf 7 :
4ibbedt high feuel Pueguamming fmauge with both prec :
clon acho 7 Aulfebfe for sesibling orm! tudlepmen|
tosious obbcafions. ve .
Python oat cleweldoed” by “Aublo vor Oe
Nofiond! Regessoh Inafifele fe Mofbemafig end Compuler Selence In a
Netherfandé in, 1990. Indpined by Monty Python's Fiktiog Cee
Comed;
ty estes, he named the fon Python. . ne he
In Python, decforiofion Oe itil doef rok seg het pus i
Apecificlon op fhe’ cola. dye. Se, tk t called x elyremie
cue. Tf is abplicable for derived types ofse. L 2
. The Pathon “lt or fofatform Lindeberdenf pHopenr
denqunge. tf cant in iprekay hich will Hood fe
yiom fine by fine cured eonuenif- Hf info mochine code. The inter
a0 will generle he Byfe cade ox the oulpu. ]
i Duthon patoguesrnming aupbexfs fe fob loon [|
ach which alfoos he wage of functions. 1 alto upporlt boltem—'
ciblesoach which olloos fre wwoge of efouas and objeds.
Abbfiestiong of Pythons
* Web ctnd Infosnef. cleuefofrenf.
. aa and numeric
. ion
* Detklob Gusts
* Soffisoue development
ie sraateeeaaeaeeaeanan Ea ae ww!
© Scanned with OKEN Scanner
etS fine. Commenf. (single)
1) —> muffiple commer ou comments en deuertol (inet af once ond
Called panospobh comment.
Fe Prteguemming 1 Cycle fot Python + :
PUthon's » cleuelobmenf- eyele if clneimafically hotles,
than fhof- +f feocdifionef took, In Putten, fheve axe no compile = dink ;
AAbI- Athen prigrems simply tno madly of sunflme and ave the ob.
ch phe confain. ,
oN)
py deb ddepent. oye ith role Hood
.
\
1 pt gata
wy)
Eee
us
Afhon cldenfation: Thaenpli)
wrfelion-sefo fo the haces of the beginning of a
Pybbon uses Idbenfalion fo indicafe block f cok,
Exanfofe:
Code fine.
IE so2,
Paiok (Pie i great than foo")
a i
© scanned with OKEN ScannerA @
TOE eral ft Development Envitionment. Uh j4 cx
Patoguamming Enuitionment thal. confains a lel of rings in ax tingle pock-
O46 tes Code, exblew, Combilen, clebuuggey ort who you dee If whe fou oef-
ph? Lk acfoally 0 seffoane feblicallon thal pipuicley Compseherie
cPiflex fo combelen [ostegucmmey afhioone Le opment.
Patho Moved on comand which sun in the blow.
che ode of Python fOLE one celled Aheths
| Arferecling with Python Pucgsend :
Print (' Hello welcome fo Python’)
Prine ( Awelome Python)
xine C 'Temks BET!)
Eferenfs ef Python :
* Botic dof. Pyper and conflsinen + Vasile ramet cin exdignmerf-
|) + Confol: Bitenching etn (eebing + Pnefons
* Sxceftiond ~ one ebock 4 + chaydey
l “abe Conuesuion :
Prthon defer ype conuesition bare ;
OL one dl fo i “ fircfions fo clittectly Cons
| Five nope vette 1 Ld in cloeg fo cox and Compe -
fink fo bose): Fs
furefion Conver any clo fipe fo inlegex. ‘Bose’ bec ifies
© Scanned with OKEN ScannerSe
He boieln tchich doing 14 sf fa fype abe -
2 Poot) ; Tu funcfion i died fo cores. emmy cbf dybe foo fete
bein. rumbex,
Gy 4 Puthon code fo demenibife be convertion
He biting ink). Plaf-¢)” ,
te Wiki iging Apu
S=" looto® q
Ae MinLing Aber conuesting fo Inf bege 2.
cain (82)
Psird. (* Affe conuenting fo WV bose 2!" end =" ”)
aah gfe ager
AE prinfing thing cenueiting fo Floof-,
2 Pht) : % 4
Pink. comuesting fo Flof 1, end="n)
mute) 4
oupet
Alfesr conuerthing fo in bee 2: 18
After cornering fo Moh: [0 010.0
BodC): This fanelion js ted fo conven. a chevacley fo Haing Inlagor,
4 ber Ot Thit funelion 14 fo conuenp- tnheger fo hexadecimal being .
Sod): This farchien ig fo convert} i fo oclef -fuing .
6 fublety: Fis urefien ig bed fo conuent #0 o fople.,
gt AED: Ths functor Siefusns the dype offer convening 40 4¢.
8 Mik: ur” function ia sed 4o canuenf. ory clofe type fo or Sil. Aybe.
a
© scanned with OKEN Scanner~
Fe Begun Cycle fer Python: @»
He Paiogsamming cycle is the ‘spiel roelel : fee
Heuied Jo of fhe abblisalten clevlepment. fife eysler which
os fpucce fo sign. eve. fal endl ebley, for.
Fre clevefomenf. cycle of putter (4 contidlenably,
shotler fhon fol ef famdiftendd feel. exe exe no combifetien
oH linking debe In Python. Python Patogstams diroply import rad-
Yet of- yunfime and ave phe objfeee foes cenfein. Because f
thu. Pythen PHoguamd sun immecifely offer changes OMe ts
‘
Qo THE APPLICATION
Test THE APPLICATION
EDIT Soukce Coe ASA
Glebe)
eepedt (tf NEEDED)
Propping Caste fox Pthon _
Tape Conuension +
Examble -
eid: pHing (one (a y
4 oxtpd 6S
beM sink (hex{ 10)
‘ P
} ofp — ona
© scanned with OKEN ScannerOct: paint (ock( 10) )
> Oo12
Tiple: paint ( tuble('4'))
ope: ('A'.)
Sef: paint (4c (101)
o-tpt- (18°, )
print ( 4eF (10) )
ofp 2", (Ord ‘
Lube punk (GEC 'A'))
Lal
oue {2 puro bet +
puna tak (ilo (*Fleme enter noe")
Widnes
wen re oy tHe
nun = nun/{to
pon (edoe =,
\
ute
- 5
evecsenin® uso
mgenonens questi. *
he Saas a
© scanned with OKEN ScannerHe bil) Purein be woul on ve
Fhe inal punefion i4 Led arccefof- ain 1
fem o dey. A puogvammey fete cq Aye fo tnpof- ax Uofue by
mirtking. Aue of inbud 0.
oO
Uottable name. = inbuf- Csfuiog']
Se Wstle oo PHogsiem fo slead sings fuer fre key board
Sl = Input." nfesy Shyng 11)
S42 = Infout- (' Ener Seing?:1)
Patil. (* tung =’, Sat |
Paint (° Sleing 2 =") Stu2
Enlew Stelng t Hello /
Ente Ginga ; toefeome to Python Buoguarnsing
Suing 4 = Hello /
Shing? = veelesme fe Python Programming.
Fre euel() Punefion :
The ba fos eve funelion ig fo cvalvafe tt
toker a1 theing ot potiamafesy oid toe “fc fk ae Python
exbuetsion.
Seal (+ print (* Hellor)’ )
ob 1 Hello
qExbsetsions :
Meef. dtefemenk, confesin exbsemions. An exb.s ?
. > PYIHo Mt
ot block 3 a et Producer o setll a a ofue. ga Oe
[be boeken Sta oer, Sptlou ac? gee id 643. An exbserten can
Ausiqnmnent. defemenf jx funcemente fo python
© Scanned with OKEN Scannerken : deel
A Paogmicum in PYTHON cenleting « acpuerrce of il aia
Pubhon bscaiky earch dfefernenf. info deguence fexicaf corn free
Of fokents Sey fete bond ‘ @ .
twine ef ten, 0% feeheg to dlemanl he
SD Ga Gas) Gos) CE)
Tokens in Puithon
The Paine () Cuncfion »
In on, a furelion if a bf sfolemenh tet
axe bof fogdher fo foe ° ee fesk, etn y pri fee
fon it fo lisboa. the confenfs on fhe deHeen. The dynfew of bert
fuirelion i
|
The cetqument- +f fhe Priinf funcfien com be cs udlse of ong
| Pye Ink. ate, fe ete. tL aan fio be a uofue sfered in ar vouable
\&, Print (‘Hello Loefeome fo Python Broguetnmring ')
elp- Hell Weleome fo Python Biogramming .
|. pring (10000)
- 10000
+ prin (*piublayy s4elng Deroo")
olp- Dispplerg sfaieg Demo.
ct a
© scanned with OKEN Scanner| AR Ia hevo the objedk seolted by om Cxbrertion de prieseriiead “a
Botie Ausignmend:
We creole and chenge. Uosriabler fovioonify with the o4si
men. Meherment.. Thig Malemen{- prod ie an exfosef fon “ a wife
name which (oil be uted fo tube fhe value of fhe exbrettion.
Som = 150
Prlee = 3e5, +0(8r0
Ufut = thoes Price
Prod uoflce
te Heue =" yg aymbof Indicafes Onignment.,
| Augmented Assi Assignment: :
Any f the Lsuol arifimelic operafery con be com-
bined tiff, estignment- Lo cveofe an ourgmenteal attignmenf- Geferent.,
& atey
3 Meng & =aty
&e
|
/
—~ Patofio =0
RE esi
Porfoliot = 7S 1 44/8.0
Prin} Petal
Auithmelic, opeselon :
custifbmelic obeseliong ba” = cio om a ea |
Obeofey tufsfratifed by Python aste qiten below x
ae Sgt AES at etre
ete a ala eee
Theses ete, Maye i afer the muitsicrion obesobion ¢
© Scanned with OKEN Scanner“he 7! obes a fi e
erates iy tued fo fhe. cluidion opeHofion befcee
the hoo Inbal “4 berfoum
Tre 2.) ohestolon i uted fo saben fhe semeindex ef fe slide
| bereton behoeen the tioo Infuf- tohuss up
"The '#4" cheer ix tied for calublig the erveneri
° The sp opertoley 14 Led to reriflesn fhe floor dluton ope.
fon beliaeen fhe foo Inpuf clafa valluts.
Operiofoy Arecedance :
+ Opexiofou precedence cadesmines fhe exiles In which ‘
He Python inter pues eucluals the cforofers in an exppsieltion.
Exponentaf
Plus, minus, Bifoxe nof
Mulfifficopien, diulten, infer clialton and
semoinceu a
Binony Addifion , Subfsacfion
Leff eine sig Ait
Bifwite AND
Bitoue xoR
Bifoe oR
CombexHon 4
Egvalify le
Assignment. opesiofons
Tclanlity Is
in, not in Membeudhio oper
Nof- Boolean Nof-
And Goofesin and
o# Boolean oy
© scanned with OKEN Scanner0 hl T_£z——= — a
\ 8 a
A boolsem exfuetsion i ar exfanettion Phef- 14 eifer
due al felie.
Booleans selsaenf. one of fio woluss: Bue ot Fete,
—— S>> Q==2
“Tue,
4 Te combenidey cperoloy = = corflning fio epuol tignd. (phereos
the ati gnment obexiofon = confeunt onfy one egvaf sIYr.
when Yau compare floo wolusr, phe exlosiarsiom ig evebisfed
Oind Python stelorint fhe Boolean ovtizeh.
SL pain (1039).
puiok (to = =3)
Paint (to <9)
ontpu sa
| rofte.
Pobe
He The bool () Punefien floes you fo evebuofe ong Lele. are yive.
gow fre o1 folde in Mefven.
oe inte (boof ¢« Hedfor)]
print (boo (153)
a
© scanned with OKEN Scanner
You might also like SDT (SDT, Synthesized, Inherited Attribute, Dependency Graph, S Attributed SDT, L Attributed SDT, Translation Scheme) PDF
SDT (SDT, Synthesized, Inherited Attribute, Dependency Graph, S Attributed SDT, L Attributed SDT, Translation Scheme)
12 pages