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

QuestionDay1 Python Basics Functions

This document is a pre-board practice paper for Class XII Computer Science (Python) covering various objective type questions, short answer questions, and coding exercises. It includes questions on Python functions, data types, string manipulation, and dictionary operations. The paper is structured into three sections: objective type questions, short answer type questions, and short answer type II questions.

Uploaded by

Monishree .G
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 views5 pages

QuestionDay1 Python Basics Functions

This document is a pre-board practice paper for Class XII Computer Science (Python) covering various objective type questions, short answer questions, and coding exercises. It includes questions on Python functions, data types, string manipulation, and dictionary operations. The paper is structured into three sections: objective type questions, short answer type questions, and short answer type II questions.

Uploaded by

Monishree .G
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

DAY 1 · Friday, 13 March 2026 Sri Chaitanya Educational Institutions

Python XI Revision + Functions Class XII | CBSE | Computer Science 083


Pre-Board Practice | 2025-26

SECTION A — OBJECTIVE TYPE / MCQ [1 Mark Each]

[Link] Question Marks


Q.1 State if the following statement is True or False: [Link](2,3) and 2**3 return 1
the same type of result. (Note: [Link] returns float; ** returns int for integer
operands.)
Q.2 State the correct output of the following code: 1
text1 = " Welcome "
text2 = " To PythonWorld"
result = [Link]() + [Link]("P", "p").
lstrip()
print([Link]("To"))
a) ('WelcomeTo ', 'PythonWorld', '')
b) ['WelcomeTo ', 'To', ' pythonWorld']
c) ('Welcome', 'To', ' pythonWorld')
d) ('Welcome', 'To', 'pythonWorld')
Q.3 Consider the given expression: print(2**3**2 - 100//10%3 + 16//2**2) Which of 1
the following will be the correct output? a) 511 b) 515 c) 520 d) 4096
Q.4 If dict1 = {"Sam":77, "Ram":89, "Vijay":100}, which of the following will raise an 1
exception?
a) [Link]("Vijay")
b) print(dict1(["Sam", "Ram"]))
c) dict1["Ram"]=158
d) print(str(dict1))
Q.5 What will be the output of the following Python code? 1
count = 10
def update():
global count
count += 1
update()
print(count, end='@')
count = 5
update()
print(count)
a) 11@12 b) 11@6 c) 5@6 d) 12@6
Q.6 What will be the output of the following code? 1
L = [["Data", "Science"], ["Machine", "Learning"]]
print(L[0][1][2] + L[1][0][-1])
a) ne b) In c) en d) ie
Q.7 What will be the output of the following code? 1
st = 'Computer@Science#2026'
result = ""
for ch in st:
if [Link]():
result += ch
print(result[::3])
a) Cpece26 b) Cpecn26 c) Cmtnc26 d) Cpten06
Q.8 Consider the given expression: 1
print((True or False) and (False or not False) and not (True and False))
Which of the following will be the correct output?
a) True b) False c) 1 d) 0
Q.9 What will be the output of the following Python code? 1
text = "Python Programming"
print(text[-1::-2])
a) gimroPnhy b) gmrioPhny c) gmroPinyh d) gimrPhnoy
Q.10 Assertion (A): [Link]([4,5]) increases the length of list1. 1
Reason (R): extend() adds elements one-by-one, unlike append() which adds
the entire list as a single element.
a) Both A & R True, R is correct explanation
b) Both A & R True, R is NOT correct explanation
c) A True but R False
d) A False but R True
Q.11 State if the following statement is True or False: The data type of a variable in 1
Python can be modified during the execution of the program.
Q.12 What will be the output of the following code? 1
L=[1,2,3,3,2,1]
print(L[:-2:2])
Q.13 Consider the given expression: 1
print(not(10/5//2 or 200 and 0))
Which of the following will be the correct output?
A) True B) False C) 200 D) 0
Q.14 Read the following python code and write the output. 1
S = "python 3.14.0"
print(S[-3:6:-1] + S[-2] + S[:2])
Q.15 How many times will the following loop run? 1
x = -5
for i in range(x, 15, 5):
print(i)
A) 0 times B) 3 times C) 4 times D) infinite times
Q.16 What will be the output of the following Python statement? 1
print(19%5%5*5**1**3-100)
Q.17 What will be the output of the following Python code? 1
dict_1={1: "One",2: "Two", 3: "Three"}
dict_2={4: "Four",5: "Five"}
dict_2.update(dict_1)
print(max(dict_1))
A) 5 B) [5: 'Five'] C) 3 D) Error
Q.18 What possible output is NOT expected from the following code? 1
import random courses=["[Link]","MCA","MBA","[Link]","BSc","BBA"]
FROM=[Link](0,4)
TO=[Link](2,4)
for i in range(FROM, TO+1):
print(courses[i], end="#")
A) [Link]#MCA#MBA#[Link]#
B) MBA#[Link]#BSc#
C) MCA#MBA#[Link]#
D) [Link]#
Q.19 Select the correct output of the following python Code. 1
string_1="My program is program for you"
tup = string_1.partition("program")
print(tup)
A) ('My ', 'program', ' is ', 'program', ' for you')
B) ('My ', 'program', ' is program for you')
C) ('My ', ' is program for you')
D) ('My ', ' is ', ' for you')
Q.20 Assertion (A): We can create a tuple from non-tuple structures such as lists 1
and strings.
Reason (R): This can be performed using tuple() function. When a string is
converted, each character becomes a separate element.
A) Both A & R True, R correct explanation
B) Both A & R True, R NOT correct explanation
C) A True but R False
D) A False but R True

SECTION B — SHORT ANSWER TYPE [2 Marks Each]

[Link] Question Marks


Q.21 Differentiate between keyword and identifier with two suitable examples of 2
each.
Q.22 The code below is intended to remove all vowels from a string and return the 2
count of removed vowels along with the new string. Rewrite after removing all
errors. Underline all corrections made.
def remove_vowels(text)
vowels = "aeiouAEIOU"
new_text = ' ' count == 0
for char in text:
if char not in vowel:
new_text += char
else:
count += 1
return new_text
count original = "Education"
num = remove_vowels(original)
print(result, num)
Q.23 A) Write a statement in Python to remove all whitespace from both ends of 2
string s and convert it to title case.
B) Write a one-line statement to extract the last 3 characters from string str
and convert to uppercase.
Q.24 Predict the output of the following code: 2
def FUN(s):
k=len(s)
m='' for i in range(0,k):
if s[i].isupper():
m=m+s[i].lower()
elif s[i].islower():
m=m+s[i].upper()
elif s[i].isdigit():
m=m+s[i-1]
else:
m=m+'@'
print(m)
FUN('CBSE-BOARD#2025-26')
Q.25 Predict the output of the following code: 2
d={'a':10,'b':20,'c':30}
s=0
for i in [Link]():
if i%20!=0:
s+=i//10
print(s)
Q.26 Explain infinite loop with an example. 2
Q.27 Differentiate between pop() and popitem() functions in dictionary with suitable 2
examples.
Q.28 Predict the output of the Python code given below: 2
D1={'ENGLISH':76,'SCIENCE':65}
D2={'HINDI':60,'ENGLISH':80}
for i in D1:
if(D1[i]>75):
D1[i]=D1[i]+10
[Link](D2)
print(D1)
print([Link]('ENGLISH','NOT FOUND'))
print([Link]('SCIENCE','NOT FOUND'))
Q.29 Write a function createList() in Python that accepts a list L1 as argument, then 2
changes the list where elements are sorted in descending order after removing
duplicates. Sample input: L1=[23,67,3,8,23,42,8] Output: L1=[67,42,23,8,3]
Q.30 The code provided below is intended to check if the number equals its 2
absolute value, otherwise convert it. Rewrite after removing all errors.
Underline corrections.
def absValue(n):
if (fabs(n)==n):
print("you entered a positive number")
else
n=*-1
print("Number made positive",x)
absValue(int(input("Enter the number:')))

SECTION C — SHORT ANSWER TYPE II [3 Marks Each]

[Link] Question Marks


Q.31 Predict the output of the following Python code: 3
s1 = "Code#2025@Data"
s2 = "" i = 0
while i < len(s1):
if s1[i].isalpha():
s2 += s1[i].upper()
elif s1[i].isdigit():
d = int(s1[i])
s2 += str(d * 2)
elif s1[i] in "@#":
s2 += str(len(s2))
i += 1
print(s2)
Q.32 3

Predict the output of the following Python code:


data = "AI2026@ML2025@DL2024"
parts = [Link]('@')
result = []
for part in parts:
letters = ""
digits = ""
for ch in part:
if [Link]():
letters += ch
elif [Link]():
digits += ch
total = 0
for d in digits:
total += int(d)
if len(letters) == 2:
[Link](letters + str(total))
print('#'.join(result))
Q.33 Predict the output of the following Python code: 3
name='Computer123@MyWorld2025!'
n=''
c=0
for x in range(len(name)):
if name[x].isupper():
n=n+name[x]
elif name[x].isdigit():
n=n+name[x+1]
elif name[x].islower():
n=n+name[x-1]
else:
n=n+"*!"
c=c+1
if c>=1:
break
print(n)
Q.34 Write a function CountVowel(STRING) that accepts one argument STRING, 3
finds the occurrence of each vowel in it, stores each vowel & its count as key-
value pair in a dictionary and returns the dictionary. [Count both upper and
lower case vowels] Example:
if STRING = "A girl sings beautifully."
Return: {'a': 2, 'i': 3, 'e': 1, 'u': 2}

You might also like