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

Xi Second Fifty

The document is an examination paper for Class XII Commerce at SRI VIJAY VIDYASHRAM SENIOR SECONDARY SCHOOL, focusing on Computer Science. It consists of five sections with various types of questions, including multiple-choice, short answer, and programming tasks, all requiring answers in Python. The exam is designed to assess students' understanding of programming concepts and their application in Python.

Uploaded by

svvsuganyacbse
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views5 pages

Xi Second Fifty

The document is an examination paper for Class XII Commerce at SRI VIJAY VIDYASHRAM SENIOR SECONDARY SCHOOL, focusing on Computer Science. It consists of five sections with various types of questions, including multiple-choice, short answer, and programming tasks, all requiring answers in Python. The exam is designed to assess students' understanding of programming concepts and their application in Python.

Uploaded by

svvsuganyacbse
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

SRI VIJAY VIDYASHRAM SENIOR SECONDARY SCHOOL BAGLUR

Second 50 % EXAMINATION
COMPUTER SCIENCE
CLASS: XII Commerce
Time Allowed: 3 hr Maximum Score:70

General Instructions:

 This question paper contains five sections, Section A to E.


 All questions are compulsory.
 Section A has 21 questions carrying 01 mark each.
 Section B has 07 Very Short Answer type questions carrying 02
marks each
 Section C has 03 Short Answer type questions carrying 03
marks each.
 Section D has 04 Long Answer type questions carrying 04 marks
each.
 Section E has 02 questions carrying 05 marks each.
 All programming questions are to be answered using Python
Language only.

6. What is the output of the below code:

l1=[10,20,30,40,50,60,10,20,10]

print(l1.count(10))
16. What will be the output
d1={‘rohit’:56,”Raina”:99}
print(“Raina” in d1)
a) True b) False c) No output d) Error

17.Assertion (A): Python allows function arguments to have default values; if the
function is called without the argument, the argument gets its default value.
Reason (R): During a function call, the argument list first contains default
argument(s) followed by positional argument(s).
18.
19. Define mutable and immutable data types?
20. What will be the output of the following code snippet?
M=”I#N#F#O#R#M#A#T#I#O#N#”
print(M.split("#")[2:-1])
a. ['F', 'O', 'R', 'M', 'A', 'T', 'I', 'O', 'N', '']
b. ['F', 'O', 'R', 'M', 'A', 'T', 'I', 'O', 'N']
c. ['I', 'N','F', 'O', 'R', 'M']
d. None of the above
21. Consider the code snippet given below. Find the output.
a = (5, (7, 5, (1, 2) ), 5, 4)
print((a[1][2][1],)*3)
a. (2,2,2) b. ((1,2),(1,2),(1,2)) c. 6 d.
Error
Section B
22. Identify the correct output(s) of the following code. Also write the minimum and
the maximum possible values of the variable
import random
a="Wisdom"
b=random.randint(1,6)
for i in range(0,b,2):
print(a[i],end='#')
(A) W# (B) W#i# (C) W#s# (D) W#i#s#
23. What will be the output of the following statements?
list1 = (1,2,3,4,5,6,7,8,9,10)
print(list1[::-2])
print(list1[:3] + list1[3:])
24. If d1={'a':'apple','b':'bat','c':'cat'} then, Answer using builtin functions only
i. Write the statement to returns the value of the item with the specified key
‘a’ in dictionary d1.
ii. Write the statement to Remove the last item from the dictionary
25. Write the queries for the following questions using the table Product with the
following fields. (P_ Code, P_Name, Qty, Price)
(i) Display the price of product having code as P06.
(ii) Display the name of all products with quantity greater than 50 and price
less than 500
26. a) What is the output produced by the following code –
d1={5:[6,7,8],”a”:(1,2,3)}
print(d1.values())
b) What is the length of the tuple shown below?
T=((((‘a’,1),’b’,’c’),’d’,2),’e’,3)
27. Identify the correct output(s) of the following code. Also write the minimum and
the maximum possible values of the variable final.
import random
elements=[180,90,77,65,33,12,54,4,219]
beg=random.randint(1,4)
final=random.randint(beg,5)
for z in range(beg,final+1):
print(elements[z],"@")a=(1,2,3)
a) 90@ b. 90@ c. 180@ d. 90@
77@ 70@ 12@ 4@
65@ 54@
33@ 4@

Section C
28.

29. Write a python program to calculate mean of a given list of numbers.


30. Write a python program to create a dictionary named year whose keys are
month names and values are their corresponding number of days.
Section D
31. Write a python program to input a list of numbers and swap element at the
even location with elements the elements at the odd location
Suppose the list is : L=[3,5,6,2,6,7]
After executing the program L:[5,3,2,6,7,6]
32. Write a python program to read email ID s of n-number of students and store
them in a tuple. Create two new tuple one to store only the username from the
email and second to store domain name from the email ids. Print all three
tuples at the end of the program Suppose the list contain
email=(arun21@gmail.com,vijay@yahoo.com,ajith23@yahoo.com)
The output is:
(arun21@gmail.com,vijay@yahoo.com,ajith23@yahoo.com)
(arun21vijay,ajith23)
(gmail.com,yahoo.com,yahoo.com)
33. A tuple contain marks of a student in 5 subjects.Write a python program to
calculate the grade of the student as per the following:

34. With the help of an example differentiate


a) pop() and popitem()
b) append() and extend()
Section E
36. Write a python menu driven program to input your friend’s names and their
phone numbers and store them in the dictionary as the key-value pair. Perform
the following operation
a) display the name and phone number of all your friends
b) Check if a friend is present or not in the dictionary or not
c) Modify the phone number of an existing friend?
d) Add a new key value pair in this dictionary and display the modified dictionary
37.
A. Find and write the output of the following Python code:
def Display(str):
m=""
for i in range(0,len(str)):
if(str[i].isupper()):
m=m+str[i].lower()
elif str[i].islower():
m=m+str[i].upper()
else:
if i%2==0:
m=m+str[i-1]
else:
m=m+"#"
print(m)
Display('Fun@Python3.0')
B.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy