0 ratings 0% found this document useful (0 votes) 39 views 15 pages Python Assignment 1
The document discusses various aspects of Python programming, including its features, data types, and the importance of comments. It highlights Python's open-source nature, object-oriented capabilities, and the flexibility of its data structures like lists and dictionaries. Additionally, it covers coding conventions and best practices for writing Python code.
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 Assignment 1 For Later signi of LL
si Applian ob Pyhaen,—
| Aasges oa _ ~— TF. ate i
ra peti n—el—_Pyaon Pregnarnying [egungy Blt
|
iy
PNA
1 Creme
ii) Gaerne Deve lophussd
17) Deris fep Gur
liv) Pacnine Leeming £ Arbifrial Tukliguace
V2 EF vaheddiel BppltaBinas
vid CAD Pepplicersiows
H2 What One tre Fealuus of P oy Prognamnm in
(> Re featounn of Pydaon TP ae aus a7
ie Di Fany to lem :— Pyro 1S Consicluwel — eaoy te
gy gt ye amd lean Suen Poy
lyon - Preqnewan yung
i
i
Open Source :— fron is free ancl open, Source
! so it8 Sewrce CoM iS au
! Aneslawte
Object - Oriewed == Py tron IS object = Onienk ef
Prodan purl
v
ically Taped i= Putney is chyrcass coulle —_
z are XQ clues ong, ie at
6 en. ave Of Vorlable - cour — Ching
Mosse sem ! 1044, en| 5) Portable -- Pytnoh 15 Por buble hal “cai.
Ubecl_o0 —ludliple Plad-bsries
6) | igh = Level lomgungf2 2? Serre
a me re eubprarias Culp,
JAedpl'l'
Lec bp
3 List omy foun editor Laxel for Pybsor Pregoauasi
= D Ve coke
22 Tweni J IDEA
key
> B Pa Chom
Q.4 Dencribe_madas_of — Pytnen De
hedn annul 4
DP tahective At 1
ii) Scvig fe
1) Twevactve Woeld ==
Th _inkrachye wok you tupe Yous cod
dire Hy ‘bo — Pytnoin Crakerpbter, 4 Tew serpre te.
exraluc hes fa Sage stv ty Pow aad a
whole adh oat fed jto" ib.
a cripk edt tn
|
Tn Saiph mode yt wuile mw cot wm _g text
fle 3 Sew Wits _o ty Qxtenrion, This bod
ise wher, you Wand 4 Pris ada. pe} a
CF Putnan cocks vr if Pe i Sev
| Speers raddipve GL (Hs .
|
ES plairy Building Bleck of P
[Re building bfecles of Ppt
inClucld =
| idles t= News Unf tof luatify Vorteu lex
| Leaching clarges Inaoluly arnref
aeal Steg with. a at Che “or a-2)
| .
OY pa, umolura, C) followed b
le Her (radian Sco res ry digits ( =e
qduak fers ane Cane — Styrttive *
Kuypwords Rurerveol yrords $y ype ee hound
peal atamivgs 2 “Comat pe ane
ai idutifiers .“Fxovapl @ incl) 12 cle
Wwe fey dP vot ewe, :
lube, 2- Patron Wied ivrludaton to bibvg hay
Cop £ _Leops Peapac oval chrwy
Hun _Comshusts “Proper 1 alisctebioue rs
Crucigf oy it afkus tk Cxecusbe
of Wh cod
Labi tains Por Chorin date Valu.
Daw Putri Vovantel Zar icy eater
12 fe Valuk fo
ancl tig do regained “Spiicit
ducleaube Z of Tie
Sper LE
Vware
wate Cocle tab
i - - Sy
igre agin tll refer,
S&S malt it Wore Feacleble Sir
| ~ lint Coulee Stet wiha #72.
| mult lind Comaa cul Cara LC God)
1 7 mom 1h) ed
Q:6
wm shiple quele CMAN oy,
ll
i
TWhak is Voushie 2 What af tue Rules iL
| Convention Poy Atclening Vout bal ¢ «
LA yanjaln@ jn _“Pysmeln TiS at Symbolic —Inasent hed)
| to 2 g, i
[Hor dake —haak Gar be Merugcef danni rng, Prog,
[execution 4 om?
i
Rabe Fey Dedering wel in Pyro
+ | Stat win a Letty oy Uucagcore (_) t=
[A Veriae Vituap Wut Chant wits a be
(Aq2_-a=-2) ey on lwndns Co
Por example -—
ae
|
[neal = Te
|
qiee Cousary ouly Letters herders erg 2 ~
| Yourke, your Cam incluely deren einsds 2
hee bur Camnse Covtein Speed Ctranee ters
a to ek,
| eqn
| Ser nowy = Tou kad
| ney = ene =" Soun F knticd |
asta ceo
4. Ne spores flowed.
j
Spaces Ovk ot allowed Yn avaal ae
eegnn= :
Laney omy = "I Mice!
§. | Cane Sasi ivi: =
Voriope wows GAR Cant — Sowminve
agk ac for HR twakil ad gv
(eu ase g
RPh ak
i iin
eta,
ag, =20
Eto
Prve( ©)
ia = 20| Cope tne Pyon Kaya = =
Rueruoed IKuguaroreld in Py: wo (ike TA ely Por, Wiig
L Chess Yet pete.) Gumst be Cared cod _[peradednre ©
hhamu
[ean
2p elo ets WIN pers eee eprops
Zu, Should Not Wy Spericel Speabeols
[Bveid tung y Such as @, L,
Lins Vevey e-News»
«| Cowemtors for Tecleni gy Vowweubl 25,
[Pesce Naw + —
eqs
‘Saleny = Go000 TF iYtencl of |X?
4
| Cank Foy Mult Word Vowkug “=
2.
ae Uuduacores tn Se pert aver li iM | Voniad © __
Nowa (Snes com)
SG is
telel_ pice =100Avoid cae ingde fetter
| Pveid Sings aChowwetey Vareable omg ae
ured iu hort Ieopy »
leg im
| for i in Founeye (52.
peaeci)
Ceased ‘im Atp Leppevcas «
Vonjoyes strat Should — Yourain Consent ano written,
im od Upper letters
Sars
PIs ae
MAK_USERS 2100
[Dercriihe Tudindahion in P:
> | Tn 4 de ndutation is % vd to oli flue blecleg
of fode . Te jolt as the PyAron Wwerpredey rat
a & bole a tog Specific
bloc aii Siuuad wito ht come - bevel oft
[hclimpyton one Considinecl Powh of tno Soak
lok
Tudiutakou 1 Achieved sing Wiite Space ade
tue heesgpitotai nd, of each diaeT
wa eagle
cs[ahs lO psy gets z
prine( “Ths is tre J wt)
Describe Comm euts jn Pyptnon Progacssomaing
Comments in PYtron one hee ding in fy
Colt tunt ant" ignored bef hal —lintespreder dl
wh execute of “thes Pre
i oa sae mg
+ | Comments —entounse reada)hltliby of a Code
* |) Commuk Gun _b Uden > to. 7 : elon abby
m e velit 2
LOY Stradwy, Har fede —baat
© | Comment Com — [ark tunebite ci Umusua) “oy
| Td tricky SCenenivs handled LY fat code to
| pre cel Chamoyass
- | cm be wed bo mw t
Taw Speibi Put of Yo lat yulalle mech
Mushi —
[ine
oft Comm ents,Single ica nor
Tina es fag Jivag Cour enbs Sturg Wit
Ss
hheata bees Sprabel He.
for Cxawple =
HYo Comment Vai ost
Muth -line Commert : —
We Can Waudhie nests CH
| Cowmm eviks _ in Ryton Each Cvoary Nine Why)
gee doe vot Providt shar OpHon Poy ulti lint
Plvalaa taal Howevey tent cng life port cur
| aa gle Which Wwe “can ri be Vall iver CoS nasssts
Muth lime Comments tendagl wut) e Now rae Ge
1
~ fo write eth ohiy
2 Censure G8 Sieg iar “Cotas sie
He Comment) !
| Cowan emt
Lang, Sting. Literals a& Com ty exe
6 i ing liter GAL
Met ~aih to a Vowiewl -¢ 2, Wwe Con
Wye tsar Shrisag, JiteraiA 08 Puna Comms.= = boy example am
- WALL Thy seancign w Q :
butting Comment 0112)
|
QA ___Write diferent lak ty pein Pysno uit
Gaither Cx. tan pb
Pytron Data
Types
ay xe:
Numeric Dictionary | Boolean [se ef Sequsne
I lL Tsp <
ee ferme
| | rest to [List
}- ea
1- Numeric Dara apes ao Peron
|
——___Tet_uaaeric Asin type se Pyro ve grentintt tal
| data tiak nas a4 Wameric 7 yon
Be Wwuameri
ll OUAPIRX Imo 1 a ond
Py fron ink Putman Pleel cul
i defind aa 4
-
Riferon Complex“ _clantes iia" _“Byphaosh
nT
| Fh
I JEL Is
I biegpas l= Tus vaduw is re pres owed by _Liad=
Class. Tr Contmink Positive “ay
hegabive Whel< ruarker CWibrolt fru hug
! olecivad s). Tin Pydiy , teary iS ho
te Aivath fe how en a ldegin vent
iz eu Cams: bes © Stuty in. 1
ii) | Fleet = This Vadut is Tepes ek by ha (out
H Clana, Th js a read Mraaibsy Wity 4
flouting = pei Ye presuar ation Te} Specitied
L boy duciwial Poiwk
/ 1 ss
ii) Comple Numbers i- A Coie liemaben
Le pressase) ip Coup Lex 'Cleurs
Tenis pecified 7 oA C Veal pet)
4 + Cim spans Pot) ju Fer ese
243) \
oy - a \ ‘
e-qin
im Q=5
Prim Clype (a) )
“ps oe
a v))
Print (type c
C= 24 4S)
Print (hype C0))
IL.
!
h
Liste) ‘Deut Type :
Lists one just like anys dicluned _in_ohwn
Jena whith IS Oduncl Collechon ~ of
dad Tr is Very Pexibie a3 trp fhens iy
list do not Quid jo be of Sun, Says
Creating list ny Pe oY)
List Fp Pymon Cum be Crease] by wat Placing fray 54,
PE naphg list atin
i
Ratan i \
# list Wit, int Valuy
as [1,239
print (a)
ap Vist wim Wired int 2 Shing
b= J] "Geeks" For" “Gees 4 7]
privr Cb)
Ofp i= Ci, %) 33
u Ditlcneeicg Ror), "Grete ot HD. (Hal lish j fetus
Uf
I Ty Ovo to acces ty lish ites cette
ra tnx —etunehe Tay Pyrat —latgustivg
4 Seqpune— tains — Ye pean —piaet—Pestts — Bante,”
|
Se.
Lh Gud of Ii, Tyasiees bewiag be
oe are Gl's
| Covmpuse pat Offset cy i +) =)
. ib is Cnreugia to Jap Wweite Lis 330,
I
Eras
<—
He Gus fe? Pushpa Vt Ray vd
[Pine C Renin elmer rain bat Ds)
put CQ C02)
pret Ca C!))
punt C" Accom ing uaa 4 ve “wel
pwr (aT -13)
priwe (4 [-21)
Bec war frown twr fis
Parga, feak 3 gaps i
leg rigakivefiD
Tupi Duly Type
— aad
Jigte Mila g Wise
Orda Call echoy
“Merarat¢ .
whe,
(1
gue a
ee nm Ps
Ta Pypron “abe “Tgp, tuple Chew
ea aS 2 “at — Volusys Sepe wld p
2 IcGvawa) wiko or Wwilwouk une of Parma
f
£9.
El = 0" Pushpa" URaj i)
pint (41)
Sip = CN Peg pat Raj")
Aecens. Tp eed
dy ordi to acces fap tuple teu refer ty
font judy uwabey , Und hag tnacling opeleuter [J
bo ace ann ite, 10_4_iaapie
ee GK)
wwe (41023) Op)
ie Ca f=19 J PE
iw CHT -33) 3