0% found this document useful (0 votes)
255 views2 pages

Class XII UT 1 CS Set A

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)
255 views2 pages

Class XII UT 1 CS Set A

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/ 2

D.T.E.A SR.

SEC SCHOOLs, New Delhi


Periodic Test- I July 2024
Time:- 50 minutes Class XII- Computer Science(083) Set A Marks:- 20
General Instructions:
1. This question paper contains five sections, Section A to C.
2. All questions are compulsory.
3. Section A have 12 questions carrying ½ mark each.
4. Section B has 04 Very Short Answer type questions carrying 02 marks each.
5. Section C has 02 Short Answer type questions carrying 03 marks each.

Section A
1. State True or False: “In a Python program, if a break statement is given in a nested
loop, it terminates the execution of all loops in one go.”
2. What will be the output of the following statement:
print(3-2**2**3+99/11)
3. Select the correct output of the code:

4. Which of the following will delete key-value pair for key = “Red” from a dictionary D1?
5. Consider the statements given below and then choose the correct output from the
given options:
pride="#G20 Presidency"
print(pride[-2:2:-2])
6. What possible outputs(s) will be obtained when the following code is executed?

7. Given the following dictionaries


dict_exam={"Exam":"AISSCE", "Year":2023}
dict_result={"Total":500, "Pass_Marks":165}
Which statement will merge the contents of both dictionaries?
8. Which of the following statement(s) would give an error after executing the following
code?
S="Welcome to class XII" # Statement 1
print(S) # Statement 2
S="Thank you" # Statement 3
S[0]= '@' # Statement 4
S=S+"Thank you" # Statement 5
9. Select the correct output of the code:
a = "Year 2022 at All the best"
a = a.split('2')
b = a[0] + ". " + a[1] + ". " + a[3]
print (b)
10. Consider the given expression:
not True and False or True
What will be the correct output if the given expression is evaluated?
11. State True or False “Variable declaration is implicit in Python.”
12. What will the following expression be evaluated to in Python?
print(15.0 / 4 + (8 + 3.0))

Section B
13. Rao has written a code to input a number and check whether it is prime or not.
His code is having errors. Rewrite the correct code and underline the corrections
Made.
def prime():
n=int(input("Enter number to check :: ")
for i in range (2, n//2):
if n%i=0:
print("Number is not prime \n")
break
else:
print("Number is prime \n’)
14. Predict the output of the Python code given below:
def Diff(N1,N2):
if N1>N2:
return N1-N2
else:
return N2-N1
NUM= [10,23,14,54,32]
for CNT in range (4,0,-1):
A=NUM[CNT]
B=NUM[CNT-1]
print(Diff(A,B),'#', end=' ')
15.Write a python program to remove duplicates from a given list:-
a=[10,20,30,20,10,50,60,40,80,50,40]
16. Write a program to calculate the length of a string:”python program”

Section C
17. Write a function listcharge(Arr) in python, which accepts a list of numbers and
replace each even number by value 10 and multiply odd number by 5.
Where a=[10,20,23,45]
listchange(a)
Output:- [10,10,115,225]
18. Write a function str_reverse() to reverse a string
Sample string: “python123”
Expected output:- “321nohtyp”

You might also like