Computer
Computer
Computer
TERM-II
Nov- 13. Lists • Lists: introduction, indexing, list operations (concatenation,
Dec repetition, membership & slicing), traversing a list using
loops, built-in functions: len(), list(), append(), extend(),
insert(), count(), index(), remove(), pop(), reverse(), sort(),
sorted(), min(), max(), sum(); nested lists, suggested
programs: finding the maximum, minimum, mean of numeric
values stored in a list; linear search on list of numbers and
counting the frequency of elements in a list
Jan 14. Tuples • Tuples: introduction, indexing, tuple operations
(concatenation, repetition, membership & slicing), built-in
functions: len(), tuple(), count(), index(), sorted(), min(),
max(), sum(); tuple assignment, nested tuple, suggested
programs: finding the minimum, maximum, mean of values
stored in a tuple; linear search on a tuple of numbers,
counting the frequency of elements in a tuple
15. Dictionary
• Dictionary: introduction, accessing items in a dictionary
using keys, mutability of dictionary (adding a new item,
modifying an existing item), traversing a dictionary, built-in
functions: len(), dict(), keys(), values(), items(), get(),
update(), del(), clear(), fromkeys(), copy(), pop(), popitem(),
setdefault(), max(), min(), count(), sorted(), copy();
suggested programs : count the number of times a
character appears in a given string using a dictionary,
create a dictionary with names of employees, their salary
and access them
Feb 16. Intro to • Introduction to Python modules: Importing module using
Python 'import ' and using from statement, Importing math module
(pi, e,sqrt, ceil, floor, pow, fabs, sin, cos, tan); random
Modules
module (random, randint, randrange), statistics module
(mean, median, mode)
• Digital Footprints ● Digital society and Netizen: net
17. Society, etiquettes, communication etiquettes, social media
etiquettes ● Data protection: Intellectual Property Right
Laws and
(copyright, patent, trademark), violation of IPR (plagiarism,
Ethics copyright infringement, trademark infringement), open
source softwares and licensing (Creative Commons, GPL
and Apache) ● Cyber-crime: definition, hacking,
eavesdropping, phishing and fraud emails, ransomware,
preventing cyber crime ● Cyber safety: safely browsing the
web, identity protection, confidentiality, cyber trolls and
bullying. ● Safely accessing web sites: malware, viruses,
Trojans, adware ● E-waste management: proper disposal of
used electronic gadgets ● Indian Information Technology
Act (IT Act) ● Technology & Society: Gender and disability
issues while teaching and using computers.
March Revision / Term- • Revision of all topics of Term-2 syllabus
2 Final Exam
5. Blue Print: As per the CBSE SQP to be released by CBSE on its website in due
course of time.
6. Practical Work: As per the CBSE list of suggested Practical for the Academic
Year 2022-23.
7. Worksheets: Term-I and Term-II worksheets appended below with suggested
answer key.
8. Sample QP/ Blueprint: Term-I and Term-II Sample Question Papers appended
below. QP to be set as per the CBSE SQP to be released by CBSE on its website in
due course of time.
NAVY CHILDREN SCHOOL
WORKSHEET
5. Where are data and programme stored when the processor uses them?
c. 680 MB d. 680 GB
a. Monitor b. Hardware
c. Robot d. Computer
16. 1 Byte =?
19. Data becomes ................ when it is presented in a format that people can
understand and use
WORKSHEET
a) 1 b) 2 c) 7 d) 8
4 110+110=…………
9. 110100112= ?16
10 25?10= ?2__________
WORKSHEET
WORKSHEET
a) yes
b) no
c) machine dependent
a) 31 characters
b) 63 characters
c) 79 characters
a) _a = 1
b) __a = 1
c) __str__ = 1
a) my_string_1
b) 1st_string
c) foo
d) _
5. Why are local variable names beginning with an underscore discouraged?
a) eval
b) assert
c) nonlocal
d) pass
a) lower case
b) UPPER CASE
c) Capitalized
a) unlimited length
c) underscore and ampersand are the only two special characters allowed
a) abc = 1,000,000
b) a b c = 1000 2000 3000
d) a_b_c = 1,000,000
a) __init__
b) in
c) it
d) on
NAVY CHILDREN SCHOOL
WORKSHEET
9. The expression Int(x) implies that the variable x is converted to integer. State
whether true or false.
a) True
b) False
10. Which one of the following have the highest precedence in the expression?
a) Exponential
b) Addition
c) Multiplication
d) Parentheses
NAVY CHILDREN SCHOOL
WORKSHEET
2. Given a function that does not return any value, What value is thrown by default
when executed in shell.
a) int
b) bool
c) void
d) None
3. Following set of commands are executed in shell, what will be the output?
>>>str="hello"
>>>str[:2]
>>>
a) he
b) lo
c) olleh
d) hello
a) round(45.8)
b) round(6352.898,2,5)
c) round()
d) round(7463.123,2,1)
5. What is the return type of function id ?
a) int
b) float
c) bool
d) dict
>>>x = 13 ? 2
objective is to make sure x has a integer value, select all that apply (python 3.xx)
a) x = 13 // 2
b) x = int(13 / 2)
c) x = 13 % 2
apple = mango
a) SyntaxError
b) NameError
c) ValueError
d) TypeError
def example(a):
a = a + '2'
a = a*2
return a
>>>example("hello")
a) indentation Error
c) hello2
d) hello2hello2
a) list
b) dictionary
c) array
d) tuple
10. In order to store values in terms of key and value we use what core data type.
a) list
b) tuple
c) class
d) dictionary
c) ‘3\’
d) ”’That’s okay”’
12. What is the average value of the code that is executed below ?
>>>grade1 = 80
>>>grade2 = 90
b) 85.1
c) 95
d) 95.1
hello-how-are-you
c) print(‘hello-‘ + ‘how-are-you’)
a) int
b) bool
c) float
d) None
a) True
b) False
c) Machine dependent
d) Error
a) k = 2 + 3j
b) k = complex(2, 3)
c) k = 2 + 3l
d) k = 2 + 3J
a) Boolean
b) Integer
c) Float
d) Complex
a) -5
b) -4
c) -3
d) +3
a) +5
b) -11
c) +11
d) -5
a) x = 0b101
b) x = 0x4f5
c) x = 19023
d) x = 03964
NAVY CHILDREN SCHOOL
WORKSHEET
x = ['ab', 'cd']
for i in x:
i.upper()
print(x)
a) [‘ab’, ‘cd’].
b) [‘AB’, ‘CD’].
c) [None, None].
x = ['ab', 'cd']
for i in x:
x.append(i.upper())
print(x)
a) [‘AB’, ‘CD’].
c) [‘ab’, ‘cd’].
i=1
while True:
if i%3 == 0:
break
print(i)
i+=1
a) 1 2
b) 1 2 3
c) error
i=1
while True:
if i%0O7 == 0:
break
print(i)
i += 1
a) 1 2 3 4 5 6
b) 1 2 3 4 5 6 7
c) error
i=5
while True:
if i%0O11 == 0:
break
print(i)
i += 1
a) 5 6 7 8 9 10
b) 5 6 7 8
c) 5 6
d) error
i=5
while True:
if i%0O9 == 0:
break
print(i)
i += 1
a) 5 6 7 8
b) 5 6 7 8 9
c) 5 6 7 8 9 10 11 12 13 14 15 ….
d) error
7. What is the output of the following?
i=1
while True:
if i%2 == 0:
break
print(i)
i += 2
a) 1
b) 1 2
c) 1 2 3 4 5 6 …
d) 1 3 5 7 9 11 …
i=2
while True:
if i%3 == 0:
break
print(i)
i += 2
a) 2 4 6 8 10 …
b) 2 4
c) 2 3
d) error
9. What is the output of the following?
i=1
while False:
if i%2 == 0:
break
print(i)
i += 2
a) 1
b) 1 3 5 7 …
c) 1 2 3 4 …
True = False
while True:
print(True)
break
a) True
b) False
c) None
i=0
while i < 5:
print(i)
i += 1
if i == 3:
break
else:
print(0)
a) 0 1 2 0
b) 0 1 2
c) error
i=0
while i < 3:
print(i)
i += 1
else:
print(0)
a) 0 1 2 3 0
b) 0 1 2 0
c) 0 1 2
d) error
x = "abcdef"
while i in x:
a) a b c d e f
b) abcdef
c) i i i i i i …
d) error
14. What is the output of the following?
x = "abcdef"
i = "i"
while i in x:
a) no output
b) i i i i i i …
c) a b c d e f
d) abcdef
x = 'abcd'
for i in x:
print(i.upper())
a) a b c d
b) A B C D
c) a B C D
d) error
x = 'abcd'
for i in range(len(x)):
i.upper()
print (x)
a) a b c d
b) 0 1 2 3
c) error
x = 'abcd'
for i in range(len(x)):
x = 'a'
print(x)
a) a
c) a a a a
x = 'abcd'
for i in range(len(x)):
print(x)
x = 'a'
a) a
c) a a a a
x = 123
for i in x:
print(i)
a) 1 2 3
b) 123
c) error
for i in d:
print(i)
a) 0 1 2
b) a b c
c) 0 a 1 b 2 c
Answer 1: a
Explanation: The function upper() does not modify a string in place, it returns a new
string which isn’t being stored anywhere
Answer 2: d
Explanation: The loop does not terminate as new elements are being added to the
list in each iteration.
Answer 3: c
Explanation: SyntaxError, there shouldn’t be a space between + and = in +=.
Answer 4: a
Explanation: Control exits the loop when i become
Answer 5: b
Explanation: 0O11 is an octal number.
Answer6: d
Explanation: 9 isn’t allowed in an octal number.
Answer 7: d
Explanation: The loop does not terminate since i is never an even number.
Answer 8: b
Explanation: The numbers 2 and 4 are printed. The next value of i is 6 which is
divisible by 3 and hence control exits the loop
Answer 9: d
Explanation: Control does not enter the loop because of False..
Answer 10 : d
Explanation: SyntaxError, True is a keyword and it’s value cannot be changed.
Answer 11: b
Explanation: The else part is not executed if control breaks out of the loop.
Answer 12: b
Explanation: The else part is executed when the condition in the while statement is
false.
Answer 13: d
Explanation: NameError, i is not defined.
Answer 14: a
Explanation: “i” is not in “abcdef”.
Answer 15: b
Explanation: The instance of the string returned by upper() is being printed.
Answe 16 : c
Explanation: Objects of type int have no attribute upper().
Answer 17: c
Explanation: range() is computed only at the time of entering the loop.
Answer 18 : d
Explanation: abcd a a a is the output as x is modified only after ‘abcd’ has been
printed once.
Answer 19: c
Explanation: Objects of type int are not iterable.
Answer 20: a
Explanation: Loops over the keys of the dictionary.
NAVY CHILDREN SCHOOL
WORKSHEET
>>>"a"+"bc"
a) a
b) bc
c) bca
d) abc
>>>"abcd"[2:]
a) a
b) ab
c) cd
d) dc
a) string.ascii_lowercase_string.digits
b) string.ascii_lowercase+string.ascii_upercase
c) string.letters
d) string.lowercase_string.upercase
4. What is the output when following code is executed ?
>>> str1[-1:]
a) olleh
b) hello
c) h
d) o
a) +
b) *
c) –
>>>print r"\nhello"
The output is
b) \nhello
d) error
>>>print('new' 'line')
a) Error
d) new line
>>> print(‘x\97\x98’)
a) Error
b) 97
98
c) x\97
d) \x97\x98
>>>str1="helloworld"
>>>str1[::-1]
a) dlrowolleh
b) hello
c) world
d) helloworld
a) 0xA0xB0xC
b) Error
c) 0x22
d) 33
print("xyyzxyzxzxyy".count('yy'))
a) 2
b) 0
c) error
print("xyyzxyzxzxyy".count('yy', 1))
a) 2
b) 0
c) 1
print("xyyzxyzxzxyy".count('yy', 2))
a) 2
b) 0
c) 1
print("xyyzxyzxzxyy".count('xyy', 0, 100))
a) 2
b) 0
c) 1
d) error
print("xyyzxyzxzxyy".count('xyy', 2, 11))
a) 2
b) 0
c) 1
d) error
16. What is the output of the following?
a) 2
b) 0
c) 1
d) error
1 Answer: d
2 Answer: c
3 Answer: b
4 Answer: d
5 Answer: c
6 Answer: b
7 Answer: c
8 Answer: c
9 Answer: a
10 Answer: d
11 Answer: a
12 Answer: a
13 Answer: c
14 Answer: a
15 Answer: b
16 Answer: b
NAVY CHILDREN SCHOOL
WORKSHEET
a) Controlling
b) Tracing
c) Stepping
d) Testing
a) True
b) False
a) GDB
b) GNB
c) FDB
d) FNB
a) he
b) h
c) assist
d) assistant
5. h command gives ___________
a) run
b) exit
c) execute
d) e
7. Which of the following does not affects the execution of the program?
a) Arguments
b) Environment
c) Control
d) I/o
c) no change
a) Identifying
b) Isolating
c) Test
d) Fixing
CHAPTER : LISTS
WORKSHEET
a) Error Free
b) Debug
c) Syntax Error
d) Exception
9. Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], which of the following is correct syntax for
slicing operation?
a) print(list1[0])
b) print(list1[:2])
c) print(list1[:-2])
d) all of the mentioned
10. Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1] ?
a) Error
b) None
c) 25
d) 2
11. Suppose list1 is [2, 33, 222, 14, 25], What is list1[:-1] ?
a) [2, 33, 222, 14].
b) Error
c) 25
d) [25, 14, 222, 33, 2].
>>>print(names[-1][-1])
a) A
b) Daman
c) Error
d) n
names2 = names1
names3 = names1[:]
names2[0] = 'Alice'
names3[1] = 'Bob'
sum = 0
if ls[0] == 'Alice':
sum += 1
if ls[1] == 'Bob':
sum += 10
print sum
a) 11
b) 12
c) 21
d) 22
a) [2, 6, 4].
b) [1, 3, 2, 1, 3].
c) [1, 3, 2, 1, 3, 2] .
D) [1, 3, 2, 3, 2, 1].
15. Suppose list1 = [0.5 * x for x in range(0, 4)], list1 is :
a) [0, 1, 2, 3].
b) [0, 1, 2, 3, 4].
>>>list2 = [11, 2, 2]
a) True
b) False
c) Error
d) None
a) list1.add(5)
b) list1.append(5)
c) list1.addLast(5)
d) list1.addEnd(5)
a) list1.insert(3, 5)
b) list1.insert(2, 5)
c) list1.add(3, 5)
d) list1.append(3, 5)
19. To remove string “hello” from list1, we use which command ?
a) list1.remove(“hello”)
b) list1.remove(hello)
c) list1.removeAll(“hello”)
d) list1.removeOne(“hello”)
a) 0
b) 1
c) 4
d) 2
Answers
1 – b 2 – d, 3-a,4-a,5-c,6-d,7-c,8c,9-d,10-c,11-a,12-d,13-b,14-c,15-c,16-b,17-b,18-
a,19-a,20-d
NAVY CHILDREN SCHOOL
CHAPTER : TUPLES
WORKSHEET
a) [1, 2, 3].
b) (1, 2, 3)
c) {1, 2, 3}
d) {}
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))
>>>t=(1,2,4,3)
>>>t[1:3]
a) (1, 2)
b) (1, 2, 4)
c) (2, 4)
d) (2, 4, 3)
>>>t=(1,2,4,3)
>>>t[1:-1]
a) (1, 2)
b) (1, 2, 4)
c) (2, 4)
d) (2, 4, 3)
>>>t = (1, 2, 4, 3, 8, 9)
a) [2, 3, 9].
b) [1, 2, 4, 3, 8, 9].
c) [1, 4, 8].
d) (1, 4, 8)
d = {"john":40, "peter":45}
d["john"]
a) 40
b) 45
c) “john”
d) “peter”
>>>t = (1, 2)
>>>2 * t
a) (1, 2, 1, 2)
b) [1, 2, 1, 2].
c) (1, 1, 2, 2)
d) [1, 1, 2, 2].
>>>t1 = (1, 2, 4, 3)
>>>t2 = (1, 2, 3, 4)
>>>t1 < t2
a) True
b) False
c) Error
d) None
>>>my_tuple = (1, 2, 3, 4)
>>>my_tuple.append( (5, 6, 7) )
>>>print len(my_tuple)
a) 1
b) 2
c) 5
d) Error
numberGames = {}
numberGames[(1,2,4)] = 8
numberGames[(4,2,1)] = 10
numberGames[(1,2)] = 12
sum = 0
for k in numberGames:
sum += numberGames[k]
a) 30
b) 24
c) 33
d) 12
a) Tuple
b) Integer
c) List
b) [2,3].
c) (2,3,4)
d) (2,3)
>>> a=(1,2,(4,5))
>>> b=(1,2,(3,4))
>>> a<b
a) False
b) True
d) Error, < operator is valid for tuples but not if there are sub-tuples
14. What is the output of the following piece of code when executed in Python
shell?
>>> a=("Check")*3
>>> a
a) (‘Check’,’Check’,’Check’)
c) (‘CheckCheckCheck’)
d) Syntax error
>>> a=(1,2,3,4)
>>> del(a[2])
a) Now, a=(1,2,4)
b) Now, a=(1,3,4)
c) Now a=(3,4)
>>> a=(2,3,4)
>>> sum(a,3)
c) 12
d) 9
17. Is the following piece of code valid?
>>> a=(1,2,3,4)
>>> del a
a) Array of tuples
b) List of tuples
c) Tuples of lists
d) Invalid type
>>> a=(0,1,2,3,4)
>>> b=slice(0,2)
>>> a[b]
b) [0,2].
c) (0,1)
d) (0,2)
>>> a=(1,2,3)
>>> b=('A','B','C')
>>> c=zip(a,b)
a) Yes, c will be ((1,2,3),(‘A’,’B’,’C’))
Answers
1 – b 2 – b, 3-c,4-c,5-c,6-a,7-a,8-b,9-d,10-c,11-b,12-d,13-a,14-c,15-d,16-c,17-c,18-
b,19-c,20-a
CHAPTER : DICTIONARIES
WORKSHEET
a) d = {}
b) d = {“john”:40, “peter”:45}
c) d = {40:”john”, 45:”peter”}
2. Read the code shown below carefully and pick out the keys?
d = {"john":40, "peter":45}
c) 40 and 45
d) d = (40:”john”, 45:”peter”)
"john" in d
a) True
b) False
c) None
d) Error
d1 = {"john":40, "peter":45}
d2 = {"john":466, "peter":45}
d1 == d2
a) True
b) False
c) None
d) Error
d1 = {"john":40, "peter":45}
d2 = {"john":466, "peter":45}
d1 > d2
a) True
b) False
c) Error
d) None
d = {"john":40, "peter":45}
d["john"]
a) 40
b) 45
c) “john”
d) “peter”
7. Suppose d = {“john”:40, “peter”:45}, to delete the entry for “john” what command
do we use
a) d.delete(“john”:40)
b) d.delete(“john”)
c) del d[“john”].
d) del d(“john”:40)
a) d.size()
b) len(d)
c) size(d)
d) d.len()
d = {"john":40, "peter":45}
print(list(d.keys()))
a) [“john”, “peter”].
b) [“john”:40, “peter”:45].
c) (“john”, “peter”)
d) (“john”:40, “peter”:45)
10. Suppose d = {“john”:40, “peter”:45}, what happens when we try to retrieve a
value using the expression d[“susan”]?
a) Since “susan” is not a value in the set, Python raises a KeyError exception
c) Since “susan” is not a key in the set, Python raises a KeyError exception
d) Since “susan” is not a key in the set, Python raises a syntax error
b) dict([[1,”A”],[2,”B”]])
c) {1,”A”,2”B”}
d) {}
a={1:"A",2:"B",3:"C"}
print(i,j,end=" ")
a) 1A2B3C
b) 123
c) ABC
d) 1:”A” 2:”B” 3:”C”
a={1:"A",2:"B",3:"C"}
print(a.get(1,4))
a) 1
b) A
c) 4
a={1:"A",2:"B",3:"C"}
print(a.get(5,4))
b) A
c) 5
d) 4
a={1:"A",2:"B",3:"C"}
print(a.setdefault(3))
b) C
c) {1: 3, 2: 3, 3: 3}
a={1:"A",2:"B",3:"C"}
a.setdefault(4,"D")
print(a)
b) None.
c) Error.
d) [1,3,6,10].
a={1:"A",2:"B",3:"C"}
b={4:"D",5:"E"}
a.update(b)
print(a)
a={1:"A",2:"B",3:"C"}
b=a.copy()
b[2]="D"
print(a)
a={1:"A",2:"B",3:"C"}
a.clear()
print(a)
a) None
d) {}
Answers
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
D B A B C A C B A C B C A B D B A C B D
*************
NAVY CHILDREN SCHOOL,
Subject: Computer Science (Code-083)
Class – XI Term-1
Time Allowed: 90 minutes Maximum Marks: 35
General Instructions:
• The paper is divided into 3 Sections- A, B and C.
• Section A, consists of Question 1 to 25 and student need to attempt 20 questions.
• Section B, consists of Question number 26 to 49 and student need to attempt 20 questions.
• Section C, consists of Question number 50 to 55 and student need to attempt 5 questions.
• All questions carry equal marks.
Section – A
Section A consists of 25 questions, attempt any 20 questions.
Q1. Example of input device is :
a. Keyboard
b. Scanner
c. Microphone
d. All of the above
Q3. 3TB = GB
a. 1024
b. 3072
c. 2048
d. None of the above
Q7. The decimal number is repeatedly divided by to obtain its equivalent octal number.
a. 2
b. 8
c. 10
d. 16
Q8. Decimal number is repeatedly divided by to obtain its equivalent hexadecimal number.
a. 10
b. 2
c. 8
d. 16
Q9. in a binary number are grouped together to get octal number.
a. 4 bits
b. 2 bits
c. 3 bits
d. 5 bits
Q10. Let X be a number system having B symbols only. Write down the base value of this number
system.
a. A
b. B
c. X
d. AB
Q11. Which of the following can be used as valid variable identifiers in Python?
a.4th Sum
b.Total
c.Number#
d.5Data
Python String
Q33. Write the output of the following:
print(“A#B#C#D#E”.split(“#”,2))
a. [„A‟, „B‟, „C#D#E‟]
b. [„A#‟, „B#‟, „C#D#E‟]
c. [„A‟, „B‟, „C‟ , „D‟ , „E‟]
d. Error
a. mutable
b. immutable
c. changeable
d. None of the above
print('aisabisacisadisae'.split('isa',3))
a. [„a‟, „b‟, „c‟, „disae‟]
b. [„a‟, „b‟, „cisadisae‟]
c. [„a‟, „b‟, „c‟, „d‟, „e‟]
d. None of the above
print('aisabisacisadisae'.split('isa'))
a. [„a‟, „b‟, „c‟, „disae‟]
b. [„a‟, „b‟, „cisadisae‟]
c. [„a‟, „b‟, „c‟, „d‟, „e‟]
d. None of the above
a. AnD*&
b. AnD&*
c. aNd&*
d. Error
print('hash-tag'.title())
a. HashTag
b. Hash-tag
c. Hash-Tag
d. Error
Q47. Fill in the blank given below to get output – “amit is a g@@d boy”
Section - C
Section C, consists of 6 Question (50 to 56). Attempt any 5 questions.
Case Study
Consider the code given below and answer
(a)1 (b) 3
(c) 4 (d) 2.
TERM-2 SQP
**********