DA2 Final PDF
DA2 Final PDF
DA-2
o f 5 sludcnts
AIM To stoxe he intoornad ion
he 7ade o all
a dictionasy. and find
he shudents and poiit em
PRoCEpuRE
1: Open ychasnm
mex Ko.
STER 2 Coleuloke Student' awexage
Jua
LntHali3ation 6
for i un
int Dictiuny Valuw
nam Studnts
Caav aunage
To tai avosage -
iXGaut-au DA
d- aw
auua C
O 6x da -aV tiXxqu3
o'xfat -av ws-av aveage o s
Fas -aw - atuage ofF*T
N
clas auage Sun
tF total-aves0
60 5 e L i s en (reauultlis"
Pant
E"NO
n - C 'kss avesage)
Class aveaga 9o
fantaH
Pan"e
Tesminafe
PROGRAM CODE:
"FAT": [98]
"FAT": [95]
"FAT": [93]
"FAT": [99]
"FAT": [98]
def get_average(marks):
total_sum = sum(marks)
total_sum = float(total_sum)
def calculate_total_average(students):
CAT = get_average(students["CAT"])
DA = get_average(students["DA"])
quiz = get_average(students["quiz"])
FAT = get_average(students["FAT"])
return (1 * CAT +
def assign_letter_grade(score):
return "A"
return "B"
return "C"
return "D"
else:
return "E"
def class_average_is(student_list):
result_list = []
stud_avg = calculate_total_average(student)
result_list.append(stud_avg)
return get_average(result_list)
# Student list consisting the
for i in students:
print(i["name"])
print(i["Roll number"])
print("__")
calculate_total_average(i)))
assign_letter_grade(calculate_total_average(i))))
print()
class_av = class_average_is(students)
% (assign_letter_grade(class_av)))
RESULT:
ALM To slunc he intomaion CUsloMC
hc TNER bil amourd
dickioncy nd find
PRoLEDURE
: Open Rychaarm
2 On the Leceme, SC3een CxEake a ne Pxee
6 Chong Cnfiguahiou le
h@rme
Stant 9nituniea
Tnttialge a Lal
La Lth uakiciua
hoe uunlis
9ntaipe
Cee mu
n ialige an
tmpy S
CrmonEl-A
Can Sunedonit
p-operez in
-:0
Paint mobile mumker (12t)
I funt coot o tledhucity s)
Tomuota)
PROGRAM CODE:
#<=200 3.5
#201-500 4.5
# >500 6.5
#RATES
z={}
L=['Eshank','Tony','Riya','Deep','Amit']
L2=['9908257153','9293819661','6274019371','9129667816','9814365012']
L3=[340,970,150,360,740]
z['NAME']=L
z['PHONE NO']=L2
z['consumed units']=L3
p=(z.values())
pp=[]
for i in z:
pp.append(z[i])
print("DICTIONARY IS")
print(z)
l=pp[2]
l1=pp[0]
c=l[i]
l2=pp[1]
# c=l[i]
s=0
if c<=200:
s=s+c*3.5
elif c>500:
s=s+100*3.5+300*4.5+(c-500)*6.5
print("Name",l1[i])
print("mobile",l2[i])
print("------------")
RESULT:
ALMTo find n and
uncbion.
PRoCEDURE
1Opn Kghaan
2 weleom 6Cen, Cx eoe a ne prbjek
Holdotina fama
STEP 2: Fesfom calcslahion
(h-3)
h Valwe n.
STER 6 nput
vawe T
STEP 3: nput
STEP 8: Pin
STEP 9 Pi Pr
STER to d
FLON CHnT
(-8)
(start deffatts)>def findt un
INum Fact )
d en Fact (a-)
twn P m-num acn
FF
num Fac+ )
deF And wmb (1.)
den. foct (a-g)
den fact 9)tder
n tn (nbw0)
(End PintL°Enio ihe Ualus o: td
u i t ( input))
Peant(lnfesmulaion(nRe)"findferaon
Punt "In Combiniatuon(nes)"
Fin d om b{n 7)
PROGRAM CODE:
def fact(k):
f=i=1
while i<=k:
f = i*f
i += 1
return f
num = fact(x)
den = fact(x - y)
return perm
num = fact(x)
den = fact(x - y)
return comb
n = int(input())
r = int(input())