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

Xii CS

The document contains a practice test for computer science with multiple choice, short answer and long answer questions. It covers topics like Boolean logic, string methods, lists, loops, conditional statements and their usage in Python programs.

Uploaded by

killerbeam213
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)
41 views2 pages

Xii CS

The document contains a practice test for computer science with multiple choice, short answer and long answer questions. It covers topics like Boolean logic, string methods, lists, loops, conditional statements and their usage in Python programs.

Uploaded by

killerbeam213
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

EVERWIN GROUP OF CBSE SCHOOLS 8.

Write a program that reads a string and checks whether it is a palindrome


(Kolathur-Maduravoyal-Mathur-Perambur-Surapet-Madurantakam-Rajamangalam) string or not.
CLASS: XII UNIT TEST (ONLINE) MARKS-40 9. I) What does each of the following expressions evaluate to?(2m)
30.04.2024 COMPUTER SCIENCE TIME: 1½ Hrs. L = [“These”, [“are”,”a”], [“few”, “words”], “that”, “we”, “will”, “use”]
a) print(L[3:4] + L[1:2])
Section A b) “few” in L[2]
One marks :- (5x1=5)
c) print(L[1][1])
d) print(L[2:5])
1. Consider the given expression:
not True and False or True
Which of the following will be correct output if the given expression is evaluated ? Section C
a) True Answer the following: (3x4=12)
b) False 10. Explain the following string functions with an example.
c) None a) find()
d) Null b) title()
2. Select the correct output of the code: c) Capitalize()
a = “Year 2024 at All the best” d) lstrip()
a = a.split(„2‟) 11. I) Write a program that multiplies two integer numbers without using the *
b = a[0] + “. “ + a[1] + “. “ + a[3] operator, using repeated addiction. (with output) (2m)
print(b) II) Explain jump statements with an example. (2m)
a) Year . 0. at All the best 12. Predict the output (4m)
b) Year 0. at All the best a) M = 5
c) Year . 024. at All the best N=8
d) Year . 0. at all the best while N < 15:
3.Evaluate the following expression. M=N–1
print(15.0/4+(8+3.0)) N=2*N–M
print(N, M)
4. The output of the code will be b) X = „peach‟
S = “Wonders of world” Y = „grape‟
print(S.count(„o‟) + S.index(„o‟)) Count = 0
5. State True or False while Count <len(X):
“ Multiple elements can be added at end of list by the append method” print(X[Count], Y[Count])
Count += 1
Section B
Answer the following: (4x2=8)
Section D
6. Why is Boolean considered a subtype of integers?
Answer the following: (3x5=15)
7. Explain the difference between split() and partition() method with an
13. Explain the Similarities, operators and differences between strings and lists,
example.
with an example (5m)
14. i) write a program that repeatedly asks from the users some numbers until
string „done‟ is typed. The program should print the sum of all numbers
entered.(3m)
ii) Rewrite the following code in python after removing all syntax errors.
Underline each correction done in the code. (2m)

15. i) Find the output. (2m)


Vowels=[„a‟,‟e‟,‟I‟]
Vowels.append(„o‟)
Vowels.append([„u‟])
Vowels.extend([„A‟,‟E‟])
print(“New List:”,vowels)

ii) Given three lists as list1 = [„p‟, „q‟,‟r‟], list2 = [„h‟,‟i‟,‟j‟]and list3 =
[„0‟,1‟,2‟]. Write a program that adds lists 2 and 3 to list1 as single element
each. The resultant list should be in the order of list3, Elements of list1,
list2. (2m)
iii) Find the output : (1m)
x= "wonderful nature"
print(x[:2], x[: -2], x[-2:])
print (x[6], x[2:4])
print (x[2: -3], x[-4:-21])

You might also like