0% found this document useful (0 votes)
7 views13 pages

Adobe Scan 24 May 2022 (1) (1)

The document appears to contain a series of Python code snippets and functions related to data manipulation and object-oriented programming. It includes definitions for functions, classes, and file handling operations, as well as examples of printing and processing data. Additionally, there are references to handling lists, tuples, and CSV files, indicating a focus on data analysis and programming techniques.

Uploaded by

guptashikts001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views13 pages

Adobe Scan 24 May 2022 (1) (1)

The document appears to contain a series of Python code snippets and functions related to data manipulation and object-oriented programming. It includes definitions for functions, classes, and file handling operations, as well as examples of printing and processing data. Additionally, there are references to handling lists, tuples, and CSV files, indicating a focus on data analysis and programming techniques.

Uploaded by

guptashikts001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

73

cef sunca
Tectygn a
a 10
auncCa)
Printla

nd iPA2

b-funclb)
Printlb)
O 155

def functa)
a a t10
etu7na

|tunc(a)
pmmtla)

Ol 25
SPS
22
cdef sqa)
Teun7e

Pinica)

2-1)
det A):
primtA)end= 66 )
def BO
Print B, end 65 9)
AQ
del co
BO
pnt(Cend

BAC

a= 14
a12

print la)
SPS
a= 14
def Fo
lobal a
a12
fo
Pint (a)

b 12
1
Q14
def f0
Q12
7edyrn a

af
Pni la)

o 12
719

def uncbon (0,b,C:1)


Tedurn O+ b-C
vauetuncbiom (10,12)
printlvalue)

SPS
9 20
oel unctio o,b c:D
reuyn at b-C
Value function.(lo, 12,5
PitCValue)

p212
7:2)
det unctimla,b.c1,dz5
7euzn Qdbrcld
yalue= tunchiomLL,2,d:)
pintlvalue)

32

Q66
Pript ([l:3)

62)
a5/62
Print la)

72pe tro7. 6tuple'object does mot support


Hemas 'gnment

SPS
Q:66,2
ate)-q
Print Ca)

b4,5
dzCab
Print (dLo1)

96
a-1,2
b:4.9
dab
Pnmt ld23)

>4

def product(0,b CXmore)


vaue abc
O 9m more
value Vaue
etu value
SPS
VEmuipy ( 9,5)
Pi'nt
120

a : (fab", Stabc? 66 des?)

Print (min(a)

Op ab

9 10
Lcdet sun-muubiphy Gb moze)
Sum-vauez a b
m-value 2 q¥b

fo 7 n move
Sum-valuet 9
m- vauet-7
reurn Sum VaUlue, m-value
S7 Sum-multiply l 34)
Pint S. m)

P2
913

d1:2 abe?; 5, 66def) 4

Prin+ (d:getO, 5)
op> 9 5 SPS
da2, S ab e': s, defi
Prrmt (d Tea)

p n t ld:getC0,5))

d:126 ab:5, 6 des); 7}


Printld.get c0,5)

d-112,6abe??: 5, 6def");4}
9 2 ind
print (pre sed)
elze

printlWot Presend')

ol 2vNot present

a 2,6is4?; Dy23, 3:5}


be14:5, 3:1
aupdde (b)
Print CaL33)
SPS
919
a:12, list; Li,23, 315
a Pop/ds)
arust): [3,5)
Prib (aui'st)_

2
S)23,54,2,3,
í
p i t (encs), emd: )
S.add 4))
Sqdd C(3)
Printlen cs))
LOp2 5 5

AnobjeCb
9:3
Tn pndhan, a dlass 5BLUEPRINTtor a Cocyede object

Ah?

Clas eArnphcla

s1=gampleclas)
oedatdr ls1,bage',23)
Seatlsls4, 67ame", 6John oe2
s:genderz Cmale
SPS
Lprintls1-dict.-
O2 age;23.6name 6JanPoe2 égende1':6mue

class studensi
me66 Roham2

a1shident)_
99sude nd)-
Pint(s1-2mame, endz 5 )
pzintl$2:2ame, end:66 2)

olpa Roham Roha


/0
lca udezr
s1 9tudezzk)

s2tuded)
ppk0
rint Ls1pp)

P2 122

SPS
cla cbamge i
det-init-(self,x9,2)
9elP.a 2d9}z
2 2 chamgeCl 2,3
etccbr (z, Sa)
Setadtr (x,6ay2
print laa

9
olpa NOY-

6lb2tYro

913
olb Rohan 60

Phe pyo7am yuns fine 9nd pirtu J


2

SPS
Q 22

oP> Kohan 0

92
Op 7ue

to
4ile-abj 2open"anlaads/sampletrl, 67?)
ilb-dadazfile-abjzeadlinésl5
printle. dauka)
9 2 LlLorem ipsum dol o7 sit ameb, Comsectetur
adipscing elt Viyam Condimentum Stg/ts lacs
laoree uctu uzwla laoree u Vestibulum ulko
Co7pey accum39n velit vel vehicula, Proin temp
Lacus q Cu Wunc at

tile-obj 2 0pen.ownloadp/sample.txt )
file-data ? file obi. readunes)
Lprint Ctile_dada)
ile-obi clo5el)

0
03h Openl' omloads/vegr20/7.csv') as tile-oj
le data 2hle-okj. readG nos
file-ist ust(thle-dada) SPS
Hoz column mfik-list C
Pint lrolunr)
pzint lenlcolumn)

ol Yeaz, Morih,Pas, Courzto, Repion.cid, lodHudy


langishude, Athackyze killed LNaLInded,laoged,ghay
karge-tae Jeapomtype,maalihes
|129

impat CSV
ith open(Downloads /yegr2017.GY)a3tie -obj

file-data = CSV reade rfile-obj)


fille_st : listfile-data)

CourrbyyEJ
|tor ro m tile-Ust Ll:
COunty append(rosI3J)
cOun
103
m p o r t c3y

wih open [ oon/oads/year2o1 6svas file-obj:

fle.datascsy. reade.(tile -ob)


file-U'st istGile-daba)
OOUdedpecple 2L
O7 70w in fle-Uzt [iJ
val vouL1o
SPS
val 1= 9

wgUndedpeople.append(float(val))

printint (sum(woumdedpeople)
224422

SPS

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy