Professional Documents
Culture Documents
Class XII Computer Science HHW Project
Class XII Computer Science HHW Project
Class XII Computer Science HHW Project
L4 = []
for i in range(n1):
fact = 1
x = L1[i]
for j in range(1, x+1):
fact *= j
L4.append(fact)
L5 = []
for i in range(n2):
fact = 1
x = L2[i]
for j in range(1, x+1):
fact *= j
L5.append(fact//(i+1))
L6 = []
for i in range(n3):
fact = 1
x = L3[i]
for j in range(1, x+1):
fact *= j
L6.append(int(fact**0.5))
Sum1 = 0
for i in range(n1):
Sum1 += L4[i]*2//(i+1)
Sum2 = 0
for i in range(n2):
Sum2 += L5[i]*2//(i+1)
Sum3 = 0
for i in range(n3):
Sum3 += L6[i]*2//(i+1)
Avg2 = Sum5/n5
L10 = []
for i in range(n4):
L10.append((L9[i]-Avg2)**2)
Sum6 = 0
for i in range(n4):
Sum6 += L8[i]
Sum7 = 0
for i in range(n5):
Sum7 += L10[i]
sd1 = (Sum6/n4)**0.5
sd2 = (Sum7/n5)**0.5
v1 = int(sd1)
v2 = int(sd2)
print(sd1, sd2)
***************************************************************************************
Inspect the program shown above carefully. It contains a lot of repetitive code. Try to
make the program more compact by converting various repetitive code into user
defined functions and then use those functions to carry out the required calculations
and get the same output.
A sample run of the above program is given below. You can test run your own modified
program containing functions using the same data.
General Instructions
• The project should be handwritten in A4 size paper. Write the modified program
NEATLY. You may use multi-colored pen for the same.
• Write your name, class, section, session, and subject at the top of the first page
• Staple the pages and submit the stapled document. No need for a channel file
• Work has to be original and done by the student. Plagiarized contents will not
be assessed