XII CS Worksheet 01
XII CS Worksheet 01
Session - 2025 – 26
Class – XII-SC Section –A & D Subject – C.S (083)
Worksheet – XII-CS/WS-1 Date: 16/04/2025
Note: This worksheet consists of Three (03) printed page in all.
Q1. Predict the output for value of:- (a) x=15 (b) x=8
if x<(x%3):
print(x**3)
elif x%4>=1:
print(x*4)
else:
print(x%10)
Page 1 of 3
L2=[5, 4, 3, 2, 1]
X1=len(L1)
X2=len(L2)
if X1<=X2:
for i in range(0,X1-2):
print(i, "*")
elif X1>X2:
for i in range(0, X2-1):
print(i, ",")
Q5. Find the errors in the following code and re-write the correct code:
A=int("Enter value of A")
B=int(input("Enter value for B"))
for i in range [0,5]
if A=B:
print(A)
else:
Print(B)
Page 2 of 3
M2="sCIenCe"
M3=""
for I in range(0,len(M2)+1):
if M1[I]>="A" and M1[I]<="M":
M3=M3+M1[I]
elif M1[I]>="N" and M1[I]<="Z":
M3=M3+M2[I]
else:
M3=M3+"#"
print(M3)
Q10. Find the errors in the given program and re-write the correct code.
Y=integer(input(“Enter 1 or 10”))
if Y==10:
for Y in range(1,11)
Print(Y)
Else:
for m in range(5,0,-1):
print(m)
******
Page 3 of 3