0% found this document useful (0 votes)
16 views

CS Class XI Term 2 (2022)

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)
16 views

CS Class XI Term 2 (2022)

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

Shyama Prasad Vidyalaya

Sr. Sec. School, Lodhi Estate, New Delhi -110003

2nd Term Examination

Class – XI, Subject : CS

COMPUTER SCIENCE
Time allowed: 2 hours Maximum Marks: 40

Instructions:

(i) All questions are compulsory(options given in Question 3,7,8,15,24)


(ii) Answer the questions after carefully reading the text.

PART – A

1. Given the lists L=[2 ,7,8, 6,9,17,91,56,33] Write output of [1]


(i) print(L[5 : 7])
(ii) print(L[-7:-2])

2. Explain the difference between break and continue [1]


3. What is eavesdropping? [2]
- OR -
What is cyber bullying?

4. Ananya is getting an error with the following code. Can you spot the error . [1]
T=(10,20,30)
T.append(40)
Also help Ananya to write correct code to, how he can add/concatenate an element at
the last of the tuple
5. Consider the following code and predict output [2]
dct={1: “One” , 2: “Two” , 3: “Three” , 4: “Four”}
for x in dct.values():
print (x, end= “#” )
6. Write a program to read a list of numbers and create another list which store [3]
half of each even number and double of each odd number in the list.
Example: if list is containing [3,5,6,2,7,4,5,8] then new list should
contain [6,10,3,1,14,2,10,4]

7. Write a program to input a tuple of integers and count how many numbers [2]
are divisible with 5.

For example, is tuple stores (3,7,15,35,56,45,65) then output should be


Total Number divisible by 5 are : 4
- OR –
Write a program to enter any number and check number is prime or not prime

8. Differentiate between randint() and randrange() with example [2]


- OR –
Differentiate between sort() and sorted() function

9. Write the output of the following: [2]


L= [5, 8, 5, 9, 2, 7]
L.append (11)
L.sort()
L.append ([-4,-8])
L.pop (2)
print (L)
L.remove (8)
L.extend ([17, 8])
print (L)

10. Convert the following : [2]


a. 456 from decimal to Octal
b. 1010101011 into Decimal form

11. Explain the role of indentation in python [1]


12. What is the error of following code : a,b=100 [1]
13. Draw a circuit Diagram of X=(A.B’)+(A’.B’) [1]
14. Verify Boolean expression X+Y.Z=(X+Y).(X+Z) using truth table [2]
15. Write the output of the following [2]

- OR –
Write a program to enter any string and count the frequency of each character
and print the frequency of each character

16. Suppose a string is declared as str=”STUDY CS” which one will give error [1]
a. print(str[1])
b. str[2]=’u’
c. print(max(str))

17. Explain identifiers, token, keyword [2]

18. Write the output of the following

19. Write a program to store employee name as key and salary as value for N employee
in a dictionary “emp” and find the sum of salary of each employee and print sum [3]
20. Write the output of the following [2]
p=5/2
q=p*4
r=p+q
p+=p+q+r
q- =p+r
print(p,q,r)

21. Write the name of membership operator supported by python [1]

22. Rewrite the code using while loop [2]

for i in range(5,0,-1):
for j in range(1,i+1,1):
print("*",end='')
print()

23. Explain the role of ID() and type() function [2]

24. Write a program to enter any string and count total number of upper and lower [2]
case character

- OR –
Write a program to enter any number and find the sum of all even number
and product of all odd number up to N , finally print sum and product

You might also like