0% found this document useful (0 votes)
60 views7 pages

DSL - A1 Assignment

The document describes a Python program to perform various operations on arrays. It asks the student to write a program using functions to compute: a) students who play both cricket and badminton, b) students who play either cricket or badminton but not both, c) students who play neither, and d) students who play cricket and football but not badminton. It provides the problem statement, objectives of understanding arrays and operations on them, and expected outcomes of analyzing problems and discriminating data structure usage. It also asks two questions about the definition of a structure and how to delete an element from an array.

Uploaded by

24.unknowncoder
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)
60 views7 pages

DSL - A1 Assignment

The document describes a Python program to perform various operations on arrays. It asks the student to write a program using functions to compute: a) students who play both cricket and badminton, b) students who play either cricket or badminton but not both, c) students who play neither, and d) students who play cricket and football but not badminton. It provides the problem statement, objectives of understanding arrays and operations on them, and expected outcomes of analyzing problems and discriminating data structure usage. It also asks two questions about the definition of a structure and how to delete an element from an array.

Uploaded by

24.unknowncoder
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/ 7

Moden Fdncation Society'

W
adia( ollege of ngincering. Pune
\M OF STUDENL: Askuosh lalar CLASS:
ESIERNAR: ROLL NO: 22i0201
D\EOF PERFORMANCE: DATE OF SUBMISSION:
E\MINED BY: EXPERIMENT NO: DSL. A-01
TUTLE: PERFOORM VARIOUS OPERATIONS ON ARRAY
PROBLEM STATEMENT: In sccond ycar computer engincering class. group A
student's play crickct, group B students play badminton and group C students play
football.
Wnte aPyhonprogram using functions to'compute following:
a) List of students who play both cricket and badminton
b) List of students who play either cricket or badminton but not both
c) Number of students who play neither cricket nor badminton
d) Number of students who play cricket and football but not badminton.
(Notc- While realizing the group, duplicate entries should be avoided, do not use SET
built-in functions)
OBJECTIVES:
1. Tounderstand structure of Aray.
2. To understand How Create, Display and perform various operations on
array.

OUTCOMES:

1. Toanalyze the problems to apply suitable algorithm and data structure.


2. To discriminate the usage of various data structures in approaching the
problem solution.
3. To understand concept of linear data structure

PRE-REQUISÍTES:
1. Knowledge of python programming
2. Knowledge of array
APPARATUS:
ycharm, ubuntu 18.od:C

QUESTIONS:

I. What is structure?

2. How to delete an element fromn array? (Explain logic)


lhal is sruchure ?
Sruche:
AShuckare is a Cempotik data bype thal dine a gnufed
lidt o Variable thal ae to be plaed under one nome in a
block itt allous diforent variables to be acesed y
Poiner b the sructure
asikitakion Ahla srutrn.
Non Bincar Bata Shucues
Amomic gata
tuchye
Jhuchure;
Quee Jack inked list.
Aray element q
linear hta Strucure i Soh rucues in alhich datu ed Jeguen
amanged seuenfially in lhid da eement areto arang
it Breviagy an
dlly br lierly lhoe eack cement i attaehcd
net adjusten' ckmont acess element
Sratt:ho itedfced emory dize i s cafier t
Con be randomly etprceat updakd der
ynamic : Ne tad size itComplexity Code.
o
ahich may
uhne Glidh
útne inorase
u linear ah struchures : Aate strucuret lhere clala elements
incorly, ar on lincar data Struchure
not placd Jequen tially oelement'
le Cannot tav al the n Jingle Tun.
Rata Srachn in pythen i
lt: Thy or like qirays. clich is ordord Collechon d
Thiy on cnclosed in squot brackeB.
[1,2, 3,4,
itiongry : holdt key 'Value fair endated in Curoy: bracket
The boiy as a clhoe i Jeperaed by Commas- and by Colons
liHh cach oher They at jmmutable.
: Aple , 2: Banuna?4.
fython oliecs, imnilay to (ist
lut is immutabe . -tiples at
qr enelacd in porenthesis .().

(1,2, '4,').
Sels : wiordord collchion o data that is mutable and de
not allu any chyliae eement They tnclacle meonler Jhi
tehing
Shiny : is imnutable2,3,4t.
amay o Characers. Gilte Glith
Hello tlorld"
cumeritals : Consit o inkgers ,loat (deinals), hee vales. ek.
QI Hey to delek an eement gom array ? Csplan loyic.
i) ind the clkment : inst ocate the element ha neded to
k delce clihin thë amay thig Can be done by Jeochisy for
Clements indet.
clemersafer : Ae tndig lylemt delet lale shitto all the
i) shiclements attr that index by one politon fo the le7t ill he ay
i) yesize the aoray one may alo necd t resize ae amay
YemeNe the empBy glot at the end.
t ale tind the' indee o elemput foLemdeleted
the ide
st
Thon e all elemenks h lef artiy
lude ound
Aeudo Cod
cricket, bodmiabn
,. n,, n, : no
tor iin rarge (o.n)
Cntr ou no qnd append in rpechvey is
de quel):
toi in Ae

o i in A: R:
7i not in
append ci).
for i in R: in A:
i inot
Aepend ci).
priat Aey

i inot in'e.
agpond i
C1:
oi in A

afpnd (i).
print ca
Shpli iniialize cnply lik A.6,c
&tudos in A,B.c and dis
input of no
Shp 2: Takeappiordling no o7 Brudonts.
by he l
hp 3: Take anoth empy tt A. ik clement i i pre=
AB.
Ond adso in e apPend it in As. Aint Abut r
iin A
8ep 4: Take another enmply AB i i
Q
and ik i in B Lut rot in Aappod it AB*
Skpsi Take
in Aond ofpod i ncg. prìnt ns
Sep: Take emçly tist ;
ivniiale
print cf
ay ti
in .)i |(Grn)
mpt no o< Mudents|
foy itke,
Todminnand

fi.do,l and ,

Yes
(o,c) ilint/udens talhe floy, ) /
(oiikeY ar d þudmin bn
pint ("shdent (.lhe ploy on'y
thre ",,)
Ch int nomes o
tudent uho play retuin
Cicke.Ornd odd'i
Second )
fo
Cnd
ijn for Yel end
(o,5)
Ay.offend (fiG)
b name! ol sudenk he ploy
badmjnbn' bl. affend Cbe)

in ronge Yes end


o,)
is (i>4)
oo

2 sluden'! lho ploy football

fis

NThidI
(TRid)

No
e nd
not inb,

Yyes
d.apfend (,03)

is f not emd
C

Psint ("udenls tlho play


Cncleet and tootbll only

Concluion
perkorm Variou operutiong
We purtom arays
kind Common elemenH e n aruy
Snd on Common elementi iM array

You might also like