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

1-Python Revision Tour

The document contains a series of multiple-choice questions related to Python programming concepts, covering topics such as data types, operators, string manipulation, and list operations. Each question provides four options to choose from, testing the reader's knowledge of Python syntax and functionality. The questions are structured to assess understanding of both basic and advanced Python programming principles.
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 views36 pages

1-Python Revision Tour

The document contains a series of multiple-choice questions related to Python programming concepts, covering topics such as data types, operators, string manipulation, and list operations. Each question provides four options to choose from, testing the reader's knowledge of Python syntax and functionality. The questions are structured to assess understanding of both basic and advanced Python programming principles.
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

`KRISHNA CLASSES – A Place Where Concept Communicates

Chapter 1 – PYTHON REVISION TOUR


Multiple Choice Questions
1) Which one of the following is not a valid identifier?
(a) true (b) __init__ (c) 20Decades (d) My_var
2) Which of the following keywords is a python operator?
(a) for (b) break (c) is (d) else
3) What will be the output of the operation print("\\\\\\") ?
(a) \\\\\\ (b) \\\ (c) \\ (d) Error
4) What will be the output of the expression print(10+20*10//2**3-5)
(a) 30 (b) 40 (c) 1005 (d) 130
5) Evaluate the expression print(20%-3)?
(a) -1 (b) -2 (c) 2 (d) Error
6) What will be the result of the expression True or False and not True or True ?
(a) True (b) False (c) None (d) Error
7) What will be the output of the following program?
a = {'A':10,'B':20}
b = {'B':20, 'A':10}
print(a==b and a is b)
(a) True (b) False (c) None (d) Error
8) Which of the following statements is false for python programming language?
(a) Python is free and Open source. (b) Python is statically typed.
(c) Python is portable. (d) Python is interpreted.
9) Which of the following is valid arithmetic operator in Python:
(a) // (b) ? (c) < (d) and
10) Which is the correct form of declaration of dictionary?
(a) Day={1:’monday’,2:’tuesday’,3:’wednesday’}
(b) Day=(1;’monday’,2;’tuesday’,3;’wednesday’)
(c) Day=[1:’monday’,2:’tuesday’,3:’wednesday’]
(d) Day={1’monday’,2’tuesday’,3’wednesday’]
11) Identify the valid declaration of L: L = [1, 23, ‘hi’, 6]
Page 1 of 36
CLASS XII – COMPUTER SCIENCE (083)
(a) list (b) dictionary (c) array (d) tuple
12) Suppose a tuple Tup is declared as Tup = (12, 15, 63, 80), which of the following is
incorrect?
(a) print(Tup[1]) (b) Tup[2] = 90 (c) print(min(Tup)) (d) print(len(Tup))
13) What will be the output of the following python statement?
s = "HOME ALONE"
p = [Link]("O")
print(p[1][:2]+p[-1])
(a) ALNE (b) MENE (c) MEONE (d) MEAL
14) What is the output of print("hello".find('E'))?
(a) 1 (b) 2 (c) -1 (d) Error
15) For the given list
d=[10,30,20,15,45,50,80,90]
what will be the output of the following slicing operation: d[2:7:2]
(a) [20,15,45] (b) [20, 45, 80] (c) [30, 15, 50] (d) [20, 45]
16) What will be the output of the following?
d = {"A":10, "B":20, "C":30, "A":40}
print(d)
(a) {"A":10, "B":20, "C":30, "A":40} (b) {"A":40, "B":20, "C":30}
(c) {"A":50, "B":20, "C":30} (d) KeyError
17) What will be the output of the following python code?
s="finaL eXam"
print([Link]())
(a) FinaL Exam (b) Final Exam
(c) FinaL exam (d) Error
18) Which of the following statements is False for a python String?
(a) Python Strings are immutable objects.
(b) Python Strings can be accessed using indexing.
(c) Python Strings cannot be empty.
(d) We can get a substring from an existing string using slicing.

Page 2 of 36
`KRISHNA CLASSES – A Place Where Concept Communicates
19) What will be the correct output of the following string operation?
"MALAYALAM".partition("MA")
(a) ("MA","LAYAL", "AM") (b) ("","MA","LAYALAM")
(c) ("MA","LAYALA","AM") (d) ("MALAYAL","AM","")
20) Which of the following statements will generate an error?
st = "PYTHON"
t = st*5 Statement(1)
u = st[0] + "M" Statement(2)
st[0] = "K" Statement(3)
st = st + st Statement(4)
(a) Statement(1) (b) Statement(2) (c) Statement(3) (d) Statement(4)
21) What will be the output of the following python statement?
s = "MONGO"
print(sorted(s))
(a) "GMNOO" (b) ["GMNOO"] (c) ["G","M","N","O","O"] (d) Error
22) Which of the following statements is False for a python dictionary?
(a) Dictionary Keys can be created using another dictionary.
(b) Dictionary values can be a dictionary.
(c) Dictionary Values are mutable.
(d) dict() function can be used to create a dictionary.
23) What will be the output of the following?
d = {"A":10, "B":20, "C":30, "A":40}
print(d)
(a) {"A":10, "B":20, "C":30, "A":40} (b) {"A":40, "B":20, "C":30}
(c) {"A":50, "B":20, "C":30} (d) KeyError
24) What will be the output of the following expression?
float(5 + int(4.39 + 2.1) % 2)
(a) 5.0 (b) 5 (c) 8.0 (d) 8
25) What is the value of this expression? 3*1**3
(a) 27 (b) 9 (c) 3 (d) 1

Page 3 of 36
CLASS XII – COMPUTER SCIENCE (083)
26) What can be a possible output at the time of execution of the program from the following
code?
import random
AR = [20,30,40,50,60,70];
FROM = [Link](1,3)
TO = [Link](2,4)
for K in range(FROM,TO+1):
print (AR[K],end=”#“)
(a) 10#40#70# (b) 30#40#50# (c) 50#60#70# (d) 40#50#70#
27) Identify the invalid python statement from the following:
(a) d = dict( ) (b) l = {} (c) f = ( ) (d) g = dict {}
28) List is defined as follows: a = [1,2,3,4,5]
Which of the following statements removes the middle element 3 from it, so that list a equals
[1,2,4,5]?
(a) del a[2] (b) a[2:3] = [] (c) a[2:2] = [] (d) a[2] = [] (e) [Link](3)
29) Select the correct output of the following string operation.
str1 = “Waha”
print(str1[ 3] + “Bhyi” + str1[-3:])
(a) Wah Bhyi Wah (b) WahBhyiaha
(c) WahBhyiWah (d) WahBhyiWaha
30) Select the correct output of the following code:
event = “G20 Presidency@2023”
L = [Link](“ “)
print(L[::-2])
(a) [“G ”] (b) G20
(c) [“Presidency@2023”] (d) “Presidency@2023”
31) What is printed when the following code is executed?
K = [“Ram”, “Shyam”, “Sita”, “Gita”]
print(K[-1][-1])
(a) Ram (b) m (c) a (d) Gita
32) What will be the output of the following code?

Page 4 of 36
`KRISHNA CLASSES – A Place Where Concept Communicates
d = {“Jo” : 1, “Ra” : 2 }
[Link]({“Pho” : 2})
print(d)
(a) {“Jo” : 1, “Ra” : 2, “Pho” : 2} (b) {“Jo” : 1, “Ra” : 2 }
(c) {“Jo” : 1, “Pho” :2 } (d) Error
33) What will be the output of the following Python code?
d1 = {‘a’ : 10 , ‘b’ : 2 , ‘c’ : 3}
str1 = ‘’
for i in d1:
str1 = str1 + str(d1[i]) + ‘ ’
str2 = str1[:-1]
print(str2[::-1])
(a) ‘3 2’ (b) ‘3 2 10’ (c) ‘3 2 01’ (d) Error
34) The ________ statement is an empty statement in Python.
35) A _________ statement skips the rest of the loop and jumps over to the statement following
the loop.
36) Python's __________ cannot be used as variable name.
37) The explicit conversion of an operand to a specific type is called _________ .
38) The data types whose values cannot be changed in place are called _________ types.
39) The _______ can add an element in the middle of a list.
40) The _________ only adds an element at the end of a list.
41) The keys of a dictionary must be of ________ type.
42) Dictionary is an _________ set of elements.
43) To get all the keys of a dictionary, ________ method is used.
44) Which of the following is not a keyword?
(a) Eval (b) assert (c) nonlocal (d) pass
45) What is the order of precedence in python?
i) Parentheses ii) Exponential iii) Multiplication iv) Division v) Addition vi) Subtraction
(a) i,ii,iii,iv,v,vi (b) ii,i,iii,iv,v,vi (c) ii,i,iv,iii,v,vi (d) i,ii,iii,iv,vi,v
46) What will be the value of X in the following Python expression?
X = 2+9*((3*12)-8)/10
Page 5 of 36
CLASS XII – COMPUTER SCIENCE (083)
(a) 30.0 (b) 30.8 (c) 28.4 (d) 27.2
47) Which of the following can be used as valid variable identifier(s) in Python?
(a) total (b) 7Salute (c) Que$tion (d) global
48) Which of the following statement is correct for an AND operator?
(a) Python only evaluates the second argument if the first one is False
(b) Python only evaluates the second argument if the first one is True
(c) Python only evaluates True if any one argument is True
(d) Python only evaluates False if any one argument is False
49) Which point can be considered as difference between string and list?
(a) Length (c) Indexing and Slicing
(b) Mutability (d) Accessing individual elements
50)Which of the following statement is true for extend( ) list method?
(a) adds element at last (c) adds multiple elements at last
(b) adds element at specified index (d) adds elements at random index
51) The statement del L[1:3] do which of the following task?
(a) delete elements 2 to 4 elements from the list
(b) delete 2nd and 3rd element from the list
(c) deletes 1st and 3rd element from the list
(d) deletes 1st, 2nd and 3rd element from the list
52) If L=[11,22,33,44], then output of print(len(L)) will be
(a) 4 (b) 3 (c) 8 (d) 6
53) The step argument in range() function .
(a) indicates the beginning of the sequence
(b) indicates the end of the sequence
(c) indicates the difference between every two consecutive numbers in the sequence
(d) generates numbers up to a specified value
54) If D=1,2,3. What will be the data type of D?
(a) List (b) tuple (c) set (d) invalid type
55) Consider the following code

Page 6 of 36
`KRISHNA CLASSES – A Place Where Concept Communicates
L=[‘a’,’b’,’c’,’d’]
[Link](-1)
print(L)
What would be the output?
(a)’d’ (b) [‘a’,’b’,’c’,’d’] (c) [‘a’,’b’,’c’] (d) error
56) What is the output when the following code is executed?
name=[‘Aadi’,’Beena’,’Charlie’,’David’]
print(name[-1][-1])
(a) ‘d’ (b) ‘D’ (c) ‘i’ (d) ‘Charlie’
57) What is the data type of T? T=(“See You”)
(a) tuple (b) string (c) List (d) set
58) Which of the following is not considered a valid identifier in Python?
(a) Two2 (b) _main (c) hello_rsp1 (d) 2 hundred
59) What will be the output of the following code ? print(“100+200”)
(a) 300 (b) 100200 (c) 100+200 (d) 200
60) pow( ) function belongs to which library ?
(a) math (b) string (c) random (d) maths
61) Suppose a tuple T is declared as T = (10, 12, 43, 39), which of the following is Incorrect?
(a) print( T[1] ) (b) print(max(T)) (c) print(len(T)) (d) None of the these
62) A list is declared as Lst = [1,2,3,4,5,6,8]. What will be the value of sum(Lst)?
(a) 29 (b) 30 (c) 7 (d) 8
63) If the following code is executed, what will be the output of the following code?
name="Computer_Science_with_Python"
print(name[-25:10])
(a) puter_S (b) hon (c) puter_Science (d) None of these
64) State True or False: Tuples can be nested.
65) State True or False: We can modify/change keys of a dictionary.
66) _____ method of list is used to delete a given element from the list.
(a) del (b) extend( ) (c) remove( ) (d) append( )

Page 7 of 36
CLASS XII – COMPUTER SCIENCE (083)
67) A tuple is declared as T = (2,66,77,55,6,9,55,8). Write the output of
print([Link](55)) ?
(a) 4 (b) 3 (c) 55 (d) None of these.
68) Which of the following is/are valid declaration of a dictionary?
(a) D = {'StuName': 'Alan', 'StuAge': 30, 'StuCity': 'Vizag'}
(b) D = ['StuName': 'Alan', 'StuAge': 30, 'StuCity': 'Vizag']
(c) D = ('StuName': 'Alan', 'StuAge': 30, 'StuCity': 'Vizag')
(d) D = {'StuName'; 'Alan', 'StuAge': 30, 'StuCity': 'Vizag'}
69) If the following code is executed, what will be the output of the following code?
Title="Online Teaching 2020"
print(Title[6:10], Title[-2:-4:-1])
(a) ‘ Tea 20’ (b) Error (c) ‘e Tea 02’ (d) None of these
70) Write the output of the python expression: print((4>5) and (2!=1) or (4<9))
(a) False (b) True (c) Error (d) None of these
71) Find the operator which cannot be used with a string in Python from the following:
(a) + (b) in (c) * (d) //
72) Which of the following is not a keyword?
(a) eval (b) assert (c) nonlocal (d) pass
73) Which value type does input () return?
(a) Boolean (b) String (c) Int (d) Float
74) The operator _____ tells if an element is present in a sequence or not.
(a) exists (b) in (c) into (d) inside
75) The keys of a dictionary must be of _____ types.
(a) Integer (b) mutable (c) immutable (d) any of these
76) What is the output when we execute list (“hello”)?
(a) [‘h’, ‘e’, ‘l’, ‘l’, ‘o’] (b) [‘hello’]
(c) [‘llo’] (d) [‘olleh’]
77) Suppose list1 is [2445,133,12454,123], what is max(list1)?
(a) 2445 (b) 133 (c) 12454 (d) 123
78) Suppose list1 is [2, 33, 222, 14, 25], What is list1 [-1]?

Page 8 of 36
`KRISHNA CLASSES – A Place Where Concept Communicates
(a) Error (b) None (c) 25 (d) 2
79) 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]
80) To add a new element to a list we use which command?
(a) [Link](5) (b) [Link](5)
(c) [Link](5) (d) [Link](5)
81) To insert 5 to the third position in list1, we use which command?
(a) [Link](3, 5) (b) [Link](2, 5)
(c) [Link](3, 5) (d) [Link](3, 5)
82) Suppose list1 is [3, 4, 5, 20, 5], what is [Link](5)?
(a) 0 (b) 1 (c) 4 (d) 2
83) Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is [Link](5)?
(a) 0 (b) 4 (c) 1 (d) 2
84) Suppose L is [3, 4, 5, 20, 5, 25, 1, 3], what is L after [Link] ([34, 5])?
(a) [3, 4, 5, 20, 5, 25, 1, 3, 34, 5] (b) [1, 3, 3, 4, 5, 5, 20, 25, 34, 5]
(c) [25, 20, 5, 5, 4, 3, 3, 1, 34, 5] (d) [1, 3, 4, 5, 20, 5, 25, 3, 34, 5]
85) If listEx is [3, 4, 5, 20, 5, 25, 1, 3], what is listEx after [Link]()?
(a) [3, 4, 5, 20, 5, 25, 1] (b) [1, 3, 3, 4, 5, 5, 20, 25]
(c) [3, 5, 20, 5, 25, 1, 3] (d) [1, 3, 4, 5, 20, 5, 25]
86) Suppose d = {“john”:40, “peter”:45}, to delete the entry for “john” what command
do we use?
(a) [Link](“john”:40) (b) [Link](“john”)
(c) del d[“john”] (d) del d(“john”:40)
87) Which of the following is not a declaration of the dictionary?
(a) {1: ‘A’, 2: ‘B’} (b) dict([[1,”A”],[2,”B”]])
(c) {1,”A”,2”B”} (d) { }
88) Which of the following isn’t true about dictionary keys?
(a) More than one key isn’t allowed
(b) Keys must be immutable
(c) Keys must be integers
Page 9 of 36
CLASS XII – COMPUTER SCIENCE (083)
(d) When duplicate keys encountered, the last assignment wins
89) What will be the output of the following Python code?
a={}
a[2]=1
a[1]=[2,3,4]
print(a[1][1])
(a) [2,3,4] (b) 3 (c) 2 (d) An exception is thrown
90) Which of the following statement prints hello\example\[Link]?
(a) print(“hello\example\[Link]”) (b) print(“hello\\example\\[Link]”)
(c) print(“hello\”example\”[Link]”) (d) print(“hello”\example”\[Link]”)
91) What will be the output of the “hello” +1+2+3?
(a) hello123 (b) hello (c) Error (d) hello6
92) Say s=“hello” what will be the return value of type(s)?
(a) int (b) bool (c) str (d) String
93) What is “Hello”.replace(“l”, “e”)?
(a) Heeeo (b) Heelo (c) Heleo (d) None
94) What will be the output of the following Python code?
Given a string example=”hello” what is the output of [Link](‘l’)?
(a) 2 (b) 1 (c) None (d) 0
95) What will be displayed by print(ord(‘b’) – ord(‘a’))?
(a) 0 (b) 1 (c) -1 (d) 2
96) What will be the output of the following Python code?
print(“abc DEF”.capitalize())
(a) abc def (b) ABC DEF (c) Abc def (d) Abc Def
97) What will be the output of the following Python code? print(‘a B’.isalpha())
(a) True (b) False (c) None (d) Error
98) What will be the output of the following Python code snippet?
print(‘my_string’.isidentifier())
(a) True (b) False (c) None (d) Error
99) What will be the output of the following Python code?

Page 10 of 36
`KRISHNA CLASSES – A Place Where Concept Communicates
print(‘[Link](‘xyy’))
(a) zxxy (b) xyxxyyzxxy (c) xyxzxxy (d) none of the mentioned
100) What will be the output? print(‘abcdef12’.replace(‘cd’,’12’))
(a) ab12ef12 (b) abcdef12 (c) ab12efcd (d) none of the mentioned
101) What will be the output of the following Python code?
list1 = [1,2,3,4]
list2 = [5,6,7,8]
print(len(list1+list2))
(a) 2 (b) 4 (c) 5 (d) 8
102) What is the output of the following?
x = 123
for i in x:
print(a)
(a) 123 (b) 1 2 3 (c) error (d) infinite
103) What data type is the object below? L = 1, 23, ‘hello’, 1
(a) list (b) dictionary (c) array (d) tuple
104) What is the value of this expression 3**3**1 ?
(a) 27 (b) 9 (c) 3 (d) 1
105) List AL is defined as follows: AL=[1,2,3,4,5]. Which of the following
statement/statements removes the middle element 3 from it so that the list AL equals [1,2,4,5]?
(a) del AL[2] (b) AL[2:3] = [ ]
(c) AL[2 : 2]=[ ] (d) AL[ 2 ] = [ ] (e) [Link](3)
106) Find the valid identifier from the following
(a) False (b) Ist&2nd (c) 2ndName (d) My_Name
107) Given the lists L=[1,30,67,86,23,15,37,131,9232] , write the output of print(L[3:7])
(a) [67,86,23,15,37] (b) [86,23,15,37] (c) None of these
108) Identify the invalid logical operator in Python from the following.
(a) and (b) or (c) not (d) Boolean
109) Which of the following is not considered a valid identifier in Python?
(a) three3 (b) _main (c) hello_kc1 (d) 2_thousand

Page 11 of 36
CLASS XII – COMPUTER SCIENCE (083)
110) Which of the following is the mutable data type in python?
(a) int (b) string (c) tuple (d) list
111) Which of the following statement converts a tuple into a list in Python?
(a) len(string) (b) list(tuple) (c) tuple(list) (d) dict(string)
112) Name of the process of arranging array elements in a specified order is termed as:
(a) indexing (b) slicing (c) sorting (d) traversing
113) What type of value is returned by input() function by default?
(a) int (b) float (c) string (d) list
114) Which of the following operators cannot be used with string
(a) + (b) * (c) - (d) All of these
115) Write the output of the following python code:
x = 123
for i in x:
print(a)
(a)1 2 3 (b) 123 (c) infinite loop (d) error
116) Write the output of following code
A = 10/2
B = 10//3
print(A, B)
(a) 5, 3.3 (b) 5.0 , 3.3 (c) 5.0 , 3 (d) 5, 4
117) Which built-in mathematical function is used to return square root of a number?
(a) SQRT( ) (b)sqrt( ) (c) sqt( ) (d) sqte( )
118) State True or False: “Tuple is datatype in Python which contain data in key-value pair.”
119) Given the following dictionaries
dict_student = {"rno" : "53", "name" : ‘Rajveer Singh’}
dict_marks = {"Accts" : 87, "English" : 65}
Which statement will merge the contents of both dictionaries?
(a) dict_student + dict_marks (b) dict_student.add(dict_marks)
(c) dict_student.merge(dict_marks) (d) dict_student.update(dict_marks)
120) Consider the given expression: not ((True and False) or True)

Page 12 of 36
`KRISHNA CLASSES – A Place Where Concept Communicates
Which of the following will be correct output if the given expression is evaluated?
(a) True (b) False (c) NONE (d) NULL
121) Select the correct output of the code:
s='mail2kc@[Link]'
s=[Link]('kc')
op = s[0] + "@kc" + s[2]
print(op)
(a) mail2@kclasses (b) mail2@lasses.
(c) mail2@kclasses. (d) mail2kclasses.
122) Which of the following statement(s) would give an error after executing the code?
D={'rno' : 32, 'name' : 'Ms Archana', 'marks' : (85,75,89),
'subject' : ['hindi','english','cs']} #S1
print(D) #S2
D['subject'][2]='IP' #S3
D['marks'][2]=80 #S4
print(D) #S5
(a) S1 (b) S3 (c) S4 (d) S3 and S4
123) What will the following expression be evaluated to in Python?
print (round (100.0 / 4 + (3 + 2.55) , 1))
(a) 30.0 (b) 30.55 (c) 30.6 (d) 31
124) Find the invalid identifier from the following
(a) Marks@12 (b) string_12 (c) _bonus (d) First_Name
125) Identify the valid declaration: Rec = (1,‟Ashoka",50000)
(a) List (b) Tuple (c) String (d) Dictionary
126) Suppose a tuple is declared as Tup = (12, 15, 63, 80) which of the following is incorrect?
(a) print(Tup[1]) (b) Tup[2] = 90 (c) print(min(Tup)) (d) print(len(Tup))
127) The correct output of the given expression is: True and not False or False
(a) True (b) False (c) None (d) Null
128) Find the output:
t1=(2,3,4,5,6)
print([Link](4))

Page 13 of 36
CLASS XII – COMPUTER SCIENCE (083)
(a) 4 (b) 5 (c) 6 (d) 2
129) Which of the following statement(s) would give an error after executing the code?
x= int("Enter the Value of x:")) #Statement 1
for y in range[0,21]: #Statement 2
if x==y: #Statement 3
print (x+y) #Statement 4
else: #Statement 5
print (x-y) # Statement 6
(a) Statement 4 (b) Statement 5 (c) Statement 4 & 6 (d) Statement 1 & 2
130) Evaluate the following Python expression: print(12*(3%4)//2+6)
(a) 12 (b) 24 (c) 10 (d) 14
131) The explicit conversion of an operand to a specific type is called _____
(a) Type casting (b) coercion (c) translation (d) None of these
132) Which of the following is not a core data type in Python?
(a) Lists (b) Dictionaries (c)Tuple (d) Class
133) What will the following code do?
dict={"Exam":"AISSCE", "Year":2025}
[Link]({"Year”:2026} )
(a) It will create new dictionary dict={” Year”:2026}and old dictionary will be deleted
(b) It will throw an error and dictionary cannot updated
(c) It will make the content of dictionary as dict={"Exam":"AISSCE", "Year":2026}
(d) It will throw an error and dictionary and do nothing
134) What will be the value of the expression : 14+13%15
(a) 12 (b) 27 (c) 3 (d) 16
135) Which of the following statement(s) would give an error after executing the 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

Page 14 of 36
`KRISHNA CLASSES – A Place Where Concept Communicates
(a) Statement 3 (b) Statement 4 (c) Statement 5 (d) Statement 4 and 5
136) What will be the output of the following expression?
24//6%3 , 24//4//2 , 48//3//4
(a) (1, 3, 4) (b) (0, 3, 4) (c) (1, 12, Error) (d) (1, 3, #error)
137) Identify the invalid Python statement from the following.
(a) _b=1 (b) __b1= 1 (c) b_=1 (d) 1 = _b
138) Identify the valid arithmetic operator in Python from the following.
(a) // (b) < (c) or (d) < >
139) if statement in Python is ______.
(a) looping statement (b) selection statement
(c) iterative statement (d) sequential statement
140) Predict the correct output of the following Python statement – print(4 + 3**3/2)
(a) 8 (b) 9 (c) 8.0 (d) 17.5
141) Choose the most correct statement among the following –
(a) a dictionary is a sequential set of elements
(b) a dictionary is a set of key-value pairs
(c) a dictionary is a sequential collection of elements key-value pairs
(d) a dictionary is a non-sequential collection of elements
142) Consider the string state = “Uttar Pradesh”. Identify the appropriate statement that will
display the last five characters of the string state?
(a) state [-5:] (b) state [4:] (c) state [:4] (d) state [:-4]
143) What will be the output of the following lines of Python code?
if not False:
print(10)
else:
print(20)
(a) 10 (b) 20 (c) True (d) False
144) Python programs are executed by which language processor?
(a) Compiler (b) Interpreter (c) Assembler (d) All of the above
145) Which of the statement is correct?

Page 15 of 36
CLASS XII – COMPUTER SCIENCE (083)
(a) Python is not portable and platform independent.
(b) Python is portable and platform dependent.
((c) Python is portable and platform independent.
(d) Python is not portable and platform dependent
146) Which function can be used to display the output in python?
(a) show( ) (b) print( ) (c) display( ) (d) output( )
147) Tick the correct statement to print Hello World.
(a) print(hello)(world) (b) Print(“hello world”)
(c) Print(hello world) (d) print(“Hello World”)
148) Which of the following is String literal?
(a) “ABC” (b) “123” (c) Both (d) None of these
149) Python code can run on a variety of platforms, it means Python is a .......... language.
(a) Graphical (b) Cross-platform (c) Independent (d) All of these
150) Python uses a/an .......... to convert source code to object code.
(a) Interpreter (b) Combination of Interpreter and compiler
(b) Compiler (d) Special virtual engine
151) The interpreter is also called ……………………
(a) Python Editor (b) Python Kernel
(c) Python shell. (d) None of the Above
152) Python interpreter executes ………………………. statement (Command) at a time.
(a) Two (b) Three (c) One (d) All command
153) The process of removing errors from programs is called __
(a) Programming (b) Documentation (c) Debugging (d) None of the above
154) IDLE stands for__________
(a) Integrated Development Learning
(b) Integrated Development Learning Environment
(c) Intelligent Development Learning Environment
(d) None of the above
155) A program written in a high-level language is called ………………

Page 16 of 36
`KRISHNA CLASSES – A Place Where Concept Communicates
(a) Compile code (b) Object code (c) Source code (d) Binary Code
156) Numbers = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?
(a) List (b) Tuple (c) Set (d) None of these
157) x=3.123, then int (x) will give?
(a) 3.1 (b) 0 (c) 1 (d) 3
158) What data type is the object below? L = {1: “One” , 2: “Two”}
(a) list (b) dictionary (c) array (d) tuple
159) What is the output of the following code?
a, b=8/4/2, 8/(4/2)
print(a, (b)
(a) Syntax error (b) 1.0, 4.0 (c) 4.0, 4.0 (d) 4, 4
160) What is the result after executing the following: print (20/4 *5+8-10)
(a) 1 (b) 23 (c) 23.0 (d) 2
161) Evaluate the following expression: 16 // (4 + 2) * 5 + 2**3 * 4
(a) 42 (b) 46 (c) 18 (d) 32
162) State True or False: Variable names can be of any length.
163) State True or False: A tuple can only have positive indexing.
164) State True or False: Logical operator not has highest precedence among all the
logical operators:
165) State True or False: Expression ‘Ab’+2 will result into ‘Ab2’
166) State True or False: “is” is a membership operator in python
167) Following code will produce True as output:
x=10>5>1 and -3<-2<-1
print(x)
(a) True (b) False
168) Find the invalid identifier from the following
(a) None (b) address (c) Name (d) pass
169) Consider a declaration L = (1, 'Python', '3.14').
Which of the following represents the data type of L?
(a) List (b) Tuple (c) Dictionary (d) String

Page 17 of 36
CLASS XII – COMPUTER SCIENCE (083)
170) Identify the valid arithmetic operator in Python from the following.
(a) ? (b) < (c) ** (d) And
171) Which of the following statements is/are not python keywords?
(a) False (b) Math (c) WHILE (d) Break
172) Which of the following is a valid keyword in Python?
(a) False (b) return (c) non_local (d) none
173) State True or False.
"Identifiers are names used to identify a variable, function in a program".
174) Identify the invalid identifier out of the options given below.
(a) Qwer_12 (b) IF (c) Play123 (d) [Link]
175) Identify the statement that will raise the error.
(a) x, y = 20 (b) a, b = 6, 7*9
(c) a = b = c = 35 (d) None of above will raise error
176) Given the tuple, Tup = (10, 20, 30, 50). Which of the statements will result in an error?
(a) print (Tup [0]) (b) print (Tup [1:2])
(c) [Link] (2,3) (d) print(len (Tup))
177) Consider the given expression : 5<10 and 12>7 or not 7>4
Which of the following will be the correct output, if the given expression is evaluated?
(a) True (b) False (c) NULL (d) NONE
178) Which of the following will give output as [5,14,6] if lst=[1,5,9,14,2,6]?
(a) print(lst[0::2]) (b) print(lst[1::2])
(c) print(lst[1:5:2]) (d) print(lst[0:6:2])
179) What is the output of following code:
T=(100)
print(T*2)
(a) Syntax error (b) (200,) (c) 200 (d) (100,100)
180) Which of the following operator cannot be used with string data type?
(a) + (b) in (c) * (d) /
181) Consider a tuple tup1 = (10, 15, 25, and 30). Identify the statement that result in an error.
(a) print(tup1[2]) (b) tup1[2] = 20
Page 18 of 36
`KRISHNA CLASSES – A Place Where Concept Communicates
(c) print(min(tup1)) (d) print(len(tup1))
182) Which one of the following is the default extension of a Python file?
(a) .exe (b) .p++ (c) .py (d) .p
183) Which of the following symbol is used in Python for single line comment?
(a) / (b) /* (c) // (d) #
184) Which of these about a dictionary is false?
(a) The values of a dictionary can be accessed using keys
(b) The keys of a dictionary can be accessed using values
(c) Dictionaries aren’t ordered
(d) Dictionaries are mutable
185) What will be the output of the following statement: print(3-2**2**3+99/11)
(a) 244 (b) 244.0 (c) -244.0 (d) Error
186) Identify the output of the following Python statements:
x = [[10.0, 11.0, 12.0] , [13.0, 14.0, 15.0]]
y = x[1][2]
print(y)
(a) 12.0 (b) 13.0 (c) 14.0 (d) 15.0
187) Select the correct output of the code :
S= "Amrit Mahotsav @ 75"
A=[Link] (" ")
print (A)
(a) ('Amrit Mahotsav', '@', '75') (b) ['Amrit', 'Mahotsav', '@', '75']
(c) ('Amrit', 'Mahotsav @ 75') (d) ('Amrit', '', 'Mahotsav @ 75')
188) Identify the output of the following Python statements.
x = 2
while x < 9:
print(x, end='')
x = x + 1
(a) 12345678 (b) 123456789
(c) 2345678 (d) 23456789

Page 19 of 36
CLASS XII – COMPUTER SCIENCE (083)
189) Identify the output of the following Python statements.
b = 1
for a in range(1, 10, 2):
b += a + 2
print((b)
(a) 31 (b) 33 (c) 36 (d) 39
190) What will be the output of following Python code?

(a) False (b) True (c) Error (d) None


191) Identify the output of the following Python statements.
lst1 = [10, 15, 20, 25, 30]
[Link]( 3, 4)
[Link]( 2, 3)
print (lst1[-5])
(a) 2 (b) 3 (c) 4 (d) 20
192) Evaluate the following expression and identify the correct answer.
16 - (4 + 2) * 5 + 2**3 * 4
(a) 54 (b) 46 (c) 18 (d) 32
193) ______ function is used to arrange the elements of a list in ascending order.
(a) sort() (b) ascending() (c) arrange() (d) asort()
194) Which of the following will delete key-value pair for key = “Red” from a dictionary D1?
(a) delete D1("Red") (b) del D1["Red"]
(c) del.D1["Red"] (d) [Link]["Red"]
195) For a string S declared as S = “PYTHON”, Which of the following is incorrect?
(a) N=len(s) (b) T=S (c) “T” in S (d) S[0]=”M”
196) Given a Tuple, tup1= (10, 20, 30, 40, 50, 60, 70, 80, 90).
What will be the output of print (tup1 [3:7:2])?
(a) (40,50,60,70,80) (b) (40,50,60,70)
(c) [40,60] (d) (40,60)
Page 20 of 36
`KRISHNA CLASSES – A Place Where Concept Communicates
197) Which of the following statement(s) would give an error during execution of the
following code?

(a) Statement 1 (b) Statement 2 (c) Statement 3 (d) Statement 4


198) Choose the correct output from the given options:
pride="#G20 Presidency"
print(pride[-2:2:-2])
(a) ndsr (b) ceieP0 (c) ceieP (d) yndsr
199) What will be the output of the following code?
tup1 = (1,2,[1,2],3)
tup1[2][1]=3.14
print(tup1)
(a) (1,2,[3.14,2],3) (b) (1,2,[1,3.14],3)
(c) (1,2,[1,2],3.14) (d) Error Message
200) Which of the following statement(s) would give an error after executing the following
code?
Stud={"Murugan":100,"Mithu":95} # Statement 1
print (Stud [95]) # Statement 2
Stud ["Murugan"]=99 # Statement 3
print ([Link]()) # Statement 4
print (Stud) # Statement 5
(a) Statement 2 (b) Statement 4 (c) Statement 3 (d) Statements 2 and 4

Page 21 of 36
CLASS XII – COMPUTER SCIENCE (083)
ANSWERS (MCQs)
1) c 2) c 3) b 4) a 5) a 6) a 7) b 8) b 9) a 10) a

11) a 12) b 13) b 14) c 15) b 16) d 17) b 18) c 19) b 20) c
28) a,b,
21) c 22) a 23) d 24) a 25) c 26) b 27) d 29) b 30) d
e
31) c 32) a 33) c 34) 35) 36) 37) 38) 39) 40)

41) 42) 43) 44) a 45) a,d 46) d 47) a 48) b 49) b 50) c

51) b 52) a 53) c 54) b 55) c 56) a 57) a 58) d 59) c 60) a

61) d 62) a 63) a 64) t 65) f 66) c 67) b 68) a 69) a 70) b

71) s 72) a 73) b 74) b 75) c 76) a 77) c 78) c 79) a 80) b

81) b 82) d 83) a 84) a 85) c 86) c 87) c 88) b 89) b 90) c

91) d 92) d 93) a 94) a 95) b 96) c 97) b 98) a 99) a 100) a
105) a,b,
101) d 102) c 103) d 104) a 106) d 107) b 108) d 109) d 110) d
e
111) b 112) c 113) c 114) c 115) d 116) c 117) b 118) f 119) d 120) b

121) c 122) c 123) c 124) a 125) b 126) b 127) a 128) d 129) d 130) b

131) a 132) d 133) c 134) b 135) b 136) a 137) d 138) a 139) b 140) d

141) b 142) a 143) a 144) b 145) c 146) b 147) d 148) c 149) b 150) a

151) c 152) c 153) c 154) b 155) c 156) a 157) d 158) b 159) b 160) c

161) a 162) t 163) f 164) f 165) f 166) f 167) a 168) a,d 169) b 170) c
171) b,c, 172) a,
173) t 174) d 175) a 176) c 177) a 178) b 179) c 180) d
d b
181) b 182) c 183) d 184) b 185) c 186) d 187) d 188) c 189) c 190) a

191) b 192) c 193) a 194) b 195) d 196) d 197) d 198) b 199) b 200) a
34) pass 35) continue 36) keyword 37) type casting 38) immutable
39) insert( ) 40) append( ) 41) immutable 42) unordered 43) keys( )

Page 22 of 36
`KRISHNA CLASSES – A Place Where Concept Communicates
Assertion – Reason Questions
Directions: Based on the statements given below, select one of the following option.
(a) Both Assertion and Reason are true, and Reason is the correct explanation for
Assertion
(b) Both Assertion and Reason are true, and Reason is not the correct explanation for
Assertion
(c) Assertion is True but Reason is False
(d) Assertion is false but Reason is True
(e) Both Assertion and Reason are False
1) Assertion: A python dictionary remains the same even if we interchange the position of
key-value pairs.
Reasoning: Dictionaries are unordered collection of key-value pairs.
2) Assertion: List is a mutable data type of Python.
Reason: In place change is not possible in list elements.
3) Assertion: in and not in are called membership operators.
Reason: They return True based on the presence of a character/substring in a given
string
4) Assertion: Python strings are mutable in nature.
Reason: Python strings are stored in memory by storing individual characters in
contiguous memory locations.
5) Assertion: append() and extend() are both methods to insert elements in a list.
Reason: While append() adds elements at the end of the list, extend can add elements
anywhere in the list.
6) Assertion: A dictionary cannot have two same keys with different values.
Reason: Keys of a dictionary must be unique.
7) Assertion: After adding element in a list, its memory location remains same
Reason: List is a mutable data type
8) Assertion: An identifier may be combination of letters and numbers.
Reason: No special symbols are permitted in an identifier name
9) Assertion: It is interpreted language.
Reason: Python programs are executed by an interpreter.

Page 23 of 36
CLASS XII – COMPUTER SCIENCE (083)
10) Assertion: Python is portable and platform independent.
Reason: Python program can run on various operating systems and hardware platforms.
11) Assertion: Python has a rich library of predefined functions.
Reason: Python is helpful in web development.
12) Assertion: Python programs are easy to understand.
Reason: Python programs have a clearly defined syntax and relatively simple structure.
13) Assertion: Python is case-sensitive.
Reason: Python does not use indentation for blocks and nested blocks.
14) Assertion: List is an immutable data type
Reason: When an attempt is made to update the value of an immutable variable, the old
variable is destroyed and a new variable is created by the same name in memory
15) Assertion: Python Standard Library consists of various modules.
Reason: A function in a module is used to simplify the code and avoids repetition.
16) Assertion: List cannot become key in a dictionary.
Reason: Only integers can be keys in a dictionary.

ANSWERS (Assertion-Reason)

1) 2) 3) 4) 5) 6) 7) 8) 9) 10)

11) 12) 13) 14) 15) 16) 17) 18) 19) 20)

Page 24 of 36
`KRISHNA CLASSES – A Place Where Concept Communicates
Short Answer Type Questions
1) A tuple is declared as T = (2,5,6,9,8). What will be the value of sum(T) and len(T) ?
2) If the following code is executed, what will be the output of the following code?
name="ComputerSciencewithPython"
print(name[3:10])
3) Write the output of:
Names=["Krati", "Mohini", "Tanishka", "Bhoomika", "Eshita",
"Dushyant", "Aditya"]
print (Names[-1:-4:-1])
4) What will be the output of the following code:
Cities=[‘Hathras’, ’Aligarh’, ‘Agra’]
Cities[0], Cities[1] = Cities[1], Cities[0]
print(Cities)
5) Predict the output:
s = “Python is fun”
l = [Link]( )
s_new = ‘-’.join([l[0].upper(), l[1], l[2].capitalize()])
print(s_new)
6) Find the output:
a, b = 5, 10
a, b = b+2, a-1
print(‘a=’, a, ‘b=’, b)
a+=2
b=b/2
print(‘a=’, a, ‘b=’, b)
7) Evaluate the following Python expression:
a) 2*3+4**2-5//2
b) 6<12 and not (20>15) or (10>5)
8) Write the Python statement for each using BUILT-IN functions/methods only:
a) To insert an element 200 at the third position, in the list L1.
b) To check whether a string named, message ends with a full stop / period or not.

Page 25 of 36
CLASS XII – COMPUTER SCIENCE (083)
9) Write a statement in Python to declare a dictionary whose keys are 1, 2, 3 and values are
Monday, Tuesday and Wednesday respectively.
10) Rewrite the following code in python after removing all syntax error(s). Underline each
correction done in the code.
30=To
for K in range(0,To)
IF k%4==0:
print (K*4)
Else:
print (K+3)
11) Rewrite the following code in python after removing all syntax error(s). Underline each
correction done in the code.
Runs=(10,5,0,2,4,3)
for I in Runs:
if I=0:
print(Maiden Over)
else:
print(Not Maiden)
12) Predict the output of the following code:
S="LOST"
L=[10,21,33,4]
D={}
for I in range(len(S)):
if I%2==0:
D[[Link]()]=S[I]
else:
D[[Link]()]=I+3
for K,V in [Link]():
print(K,V,sep="*")
13) A list named studentAge stores age of students of a class. Write the Python command to
import the required module and (using built-in function) to display the most common age value
from the given list.
14) Predict the output of the following code:

Page 26 of 36
`KRISHNA CLASSES – A Place Where Concept Communicates
Name="PythoN3.1"
R=""
for x in range(len(Name)):
if Name[x].isupper():
R=R+Name[x].lower()
elif Name[x].islower():
R=R+Name[x].upper()
elif Name[x].isdigit():
R=R+Name[x-1]
else:
R=R+"#"
print(R)
15) Predict the output of the following code:

16) Find and write the output of the following python code:
x = "abcdef"
i = "a"
while i in x:
print(i, end = " ")
17) What is the difference between a keyword and an identifier?
18) What are literals in Python? How many types of literals are allowed in python?

Page 27 of 36
CLASS XII – COMPUTER SCIENCE (083)
19) What is None literal?
20) Given the lists L=[“H”, “T”, “W”, “P”, “N”]. Write the output of print(L[3:4])
21) If the following code is executed, what will be the output of the following code?
str="Krishna Classes Hathras"
print(str[8:16])
22) Write a statement in Python to declare a dictionary whose keys are A, M, B and values
are Apple, Mango and Banana respectively
23) What is the difference between (30) and (30,)?
24) How are lists different from strings when both are sequences?
25) What will be the output of the following code snippet?
values=[]
for i in range(1,4):
[Link](i)
print(values)
26) What will be the output of the following code?
rec={“Name” : “Python”, “Age”:”20”}
r= [Link]()
print(id(r)==id(rec))
27) What will be the output of the following list operations?
data = [10,20,30,[40,50,60],[70,80]]
print(data[3]+data[-1])
print(data[-2][-2])
28) What will be the output of the following python program?
data = [10,20,30, 60,70]
data[3:3]=[40,50]
print(data)
[Link](3)
print(data)
[Link]([10,20])
print(len(data))

Page 28 of 36
`KRISHNA CLASSES – A Place Where Concept Communicates
29) Ganga is learning to use python Lists. Help her to get the answers of the following
operations based on the given list:
data = [10,20,30]
data[1:3]=[5,10]
print(data)
[Link]([3,4])
x =[Link](10)
print(data[x:])
[Link]()
print(data)
print([Link](2))
30) What will be the output of the following program?
d={'A':10,'B':20,'C':30,'D':40}
del d['C']
print(d)
x = [Link]()
print(x)
31) Sapna wants to understand the concept of methods in a dictionary. Help her to find the
answers of the following operations on a python dictionary:
d = {'M':10, 'N':20, 'O':30, 'P':40}
r = [Link]()
print(r)
x = [Link]('N')
print(x)
print(list([Link]()))
[Link]('X',60)
print(d)
32) Rahul has written a code to input a number and return its reverse. His code is having errors.
Rewrite the following code in python after removing all syntax error(s). Underline each
correction done in the code.
def reverse()
n=int(input("Enter number :: ")
rev=0

Page 29 of 36
CLASS XII – COMPUTER SCIENCE (083)
while(num>0):
r=num%10
rev=rev*10+r
num=num//10
return rev
33) Predict the output of the Python code given below:
tuple1 = (33, 24, 44, 42, 54 ,65)
list1 =list(tuple1)
new_list = []
for i in list1:
if i>40:
new_list.append(i)
new_tuple = tuple(new_list)
print(new_tuple)
34) Predict the output of the Python code given below:
s="PREboardCS*2026!"
j=2
for i in [Link]('*'):
k = i [ : j ]
if [Link]():
j=j+1
elif [Link]():
j=j+2
else:
j=j+3
print(s [ j : : j ] )
35) Given is a Python string declaration:
myexam="@@Pre Board 2026@@"
Write the output of: print(myexam[15:11:-1])
36) Write the output of the code given below:
my_dict = {"state": "Uttar Pradesh", "city":”Hathras”}
my_dict['district'] = “Hathras”

Page 30 of 36
`KRISHNA CLASSES – A Place Where Concept Communicates
print(my_dict.values())
37) Predict the output of the Python code given below:
TXT = ["20","50","30","40"]
CNT = 3
TOTAL = 0
for C in [7,5,4,6]:
T = TXT[CNT]
TOTAL = float (T) + C
print (TOTAL)
CNT-=1
38) Vivek has written a code to input a number and check whether it is even or odd. His code
is having errors. Rewrite the following code in python after removing all syntax error(s).
Underline each correction done in the code.
Def checkNumber(N):
status = N%2
return
num = int(input("Enter a number to check:"))
k = checkNumber(num)
if k = 0:
print("This is EVEN number")
else:
print("This is ODD number")
39) Predict the output of the Python code given below:
data = [2,4,2,1,2,1,3,3,4,4]
d = {}
for x in data:
if x in d:
d[x]=d[x]+1
else:
d[x]=1
print(d)
40) Predict the output of the Python code given below:

Page 31 of 36
CLASS XII – COMPUTER SCIENCE (083)
data=["L",20,"M",40,"N",60]
times=0
alpha=""
add=0
for c in range(1,6,2):
times = times + c
alpha = alpha + data [c-1] + "@"
add = add + data[c]
print (times, add, alpha)
41) Predict the output of the Python code given below:
L=[1,2,3,4,5]
Lst=[]
for i in range(len(L)):
if i%2==1:
t=(L[i],L[i]**2)
[Link](t)
print(Lst)
42) Predict the output of the Python code given below:
s = "Welcome2KC"
n = len(s)
m=""
for i in range(0, n):
if (s[i] >= 'a' and s[i] <= 'm'):
m = m +s[i].upper()
elif (s[i] >= 'n' and s[i] <= 'z'):
m = m + s[i]
elif (s[i].isupper()):
m=m+s[i].lower()
else:
m=m + ‘#’
print(m)
43) Predict the output of the Python code given below:

Page 32 of 36
`KRISHNA CLASSES – A Place Where Concept Communicates
mySubject = "Computer Science"
print(mySubject[0 : len(mySubject)])
print(mySubject[-7 : -1])
print(mySubject[len(mySubject) - 1])
print(2 * mySubject)
print(mySubject[ : : -2])
print(mySubject[ : 3] + mySubject[3 : ])
44) Predict the output of the Python code given below:
st = ""
name = "9@Days"
for x in name:
if x in 'aeiou' :
st += [Link]()
elif not [Link]( ):
st += '**'
elif [Link]( ):
pass
else:
st += [Link]()
print(st)
45) Rewrite the following code in python after removing all syntax error(s). Underline each
correction done in the code.
Num=int(rawinput("Number:"))
sum=0
for i in range(10,Num,3)
sum+=1
if i%2=0:
print(i*2)
else:
print(i*3)
print (Sum)
46) Find the following python expressions:

Page 33 of 36
CLASS XII – COMPUTER SCIENCE (083)
a) 3 – 10 ** 2 + 99 / 11
b) not 12 > 6 and 7 < 17 or not 12 < 4
c) 2 ** 3 ** 2
d) 7 // 5 + 8 * 2 / 4 – 3
e) not false and true or false and true
47) Remove the errors from the following code Rewrite the code by underlining the errors.
x = int((“enter the value”)
for i in range [0,11]:
if x = y
print x+y
else:
print x-y
48) Write the output of the following code:-
String1="Coronavirus Disease"
print([Link]("Covid"))
print([Link]("sea"))
49) Write the output of the following code:-
Text = "krishnaclasses@[Link]"
L=len(Text)
Ntext=""
for i in range(0,L):
if Text[i].isupper():
Ntext=Ntext+Text[i].lower()
elif Text[i].isalpha():
Ntext= Ntext+Text[i].upper()
else:
Ntext=Ntext+'bb'
print(Ntext)
50) Write the output of the following:
word = 'green vegetables'
print([Link]('g',2))

Page 34 of 36
`KRISHNA CLASSES – A Place Where Concept Communicates
print([Link]('veg',2))
print([Link]('tab',4,15))
51) Find and write the output of the following python code:
string1 = "Augmented Reality"
print(string1[0:3])
print(string1[3:6])
print(string1[:7])
print(string1[-10:-3])
print(string1[-7: :3]*3)
print(string1[1:12:2])
52) Differentiate between break and continue statement used in python.
53) Differentiate between type conversion and type casting in python with examples.
54) Rewrite the following code in python after removing all syntax error(s). Underline each
correction done in the code.
STRING=""WELCOME NOTE""
for S in range[0,8]:
print (STRING(S))
55) Given is a Python string declaration. Write the output of
message='FirstPreBoardExam@2025-26'
print(message[ : : -3].upper())
56) Write the output of the code given below:
d1={'rno':25, 'name':'dipanshu'}
d2={'name':'himanshu', 'age':30,'dept':'mechanical'}
[Link](d1)
print([Link]())
57) Find output generated by the following code:
Str = "Computer"
Str = Str[-4:]
print(Str*2)
58) Consider the following lines of codes in Python and write the appropriate output:
student = {'rollno':1001, 'name':'Akshay', 'age':17}
student['name']= “Abhay”
Page 35 of 36
CLASS XII – COMPUTER SCIENCE (083)
print(student)
59) Find output generated by the following code:
string="aabbcc"
count=3
while True:
if string[0]=='a':
string=string[2:]
elif string[-1]=='b':
string=string[:2]
else:
count+=1
break
print(string)
print(count)
60) Predict the output:
S = “MALYALAM AND KANNADA”
A = [Link]()
B = [Link](‘LA’)
C = [Link](‘A’)
D = [Link](‘A’)
print(A)
print(B)
print(C)
print(D)

Γ!Ͷ!ϨԨ

Page 36 of 36

You might also like