[go: up one dir, main page]

0% found this document useful (0 votes)
5 views3 pages

XII CS Worksheet 01

This document is a worksheet for Class XII-SC at Delhi Public School, Fulbari, for the session 2025-26, focusing on Computer Science. It contains ten questions that require students to predict outputs of Python code snippets, identify errors, and rewrite correct code. The worksheet spans three printed pages and includes space for student information and answers.

Uploaded by

saptaswaroy2810
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)
5 views3 pages

XII CS Worksheet 01

This document is a worksheet for Class XII-SC at Delhi Public School, Fulbari, for the session 2025-26, focusing on Computer Science. It contains ten questions that require students to predict outputs of Python code snippets, identify errors, and rewrite correct code. The worksheet spans three printed pages and includes space for student information and answers.

Uploaded by

saptaswaroy2810
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/ 3

DELHI PUBLIC SCHOOL, FULBARI

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.

Student’s Name: ___________________________________________________ Roll No. ___________________

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)

Q2. Find the output:


str="InDian"
if str[0]>="D" and str[1]<="N":
print(str[0]*2)
elif str[3]>="I" or str[4]>="A":
print(str[3]*3)

Q3. What will be the output of the given Python statements?


x="NEW World"
print(x[:1], x[:-1])
print(x[1:-3], x[-5:-2])

Q4. Find the output:


L1=[1, 2, 3, 2, 1]

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)

Q6. What will be the output of the following code fragment?


str = "India is a great country"
L = str.split("i")
for i in L:
print(i,end=" ")

Q7. Find the output:


X="HELLO"
for i in range(len(X)):
for j in range(0,i+1):
print(X[j],end="*")
print()

Q8. Find the output of the following code:


M1="ComPUtEr"

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)

Q9. Print the final value of m in the given program.


s="India@2020"
l=len(s)
m=""
for i in range(0,l):
if(s[i].isupper()):
m=m+s[i].lower()
elif s[i].isalpha():
m=m+s[i].upper()
else:
m=m+"##"
print(m)

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

You might also like