12 CS Summer - Vacation - Holiday - HW - 2024-25

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Total 05 pages

SUMMER VACATION HOLIDAY HW FOR XII CS 2024-25

Project Work:
Collect information on the following suggested project topics. And submit the synopsis of the
same

(Note: One project can be share by maximum two-three students. (but each has to submit the separate
report) You can select any other good topic also after discussing with teacher)

1. Student management system


2. Hotel management system
3. Blood banking system
4. Audio-video library management system
5. Library management system
6. Payroll management system
7. Air-ticketing system
8. Health club management system
9. Personnel management system
10. Cyber shopping system
11. Balance equation system
12. Telephone directory system
13. Retail shop system
14. Mathematical equation system
15. Optics analysis system in physics
16. Canteen management system
17. Time-table management system
18. Income tax calculation system
19. Inventory control system
20. Hospital management system
21. Metro Rail
22. Computer Added Learning System

(Topic: Revision Tour of XI Python)

Q Questions
no.
1 Out of the following, find those identifiers, which cannot be used for naming Variables or functions in a Python
program:
#Tag, While, Class, Switch, 3rdRow, finally, Column 31, Total+ , Days * Rent, For, A_price,
Grand Total, do, 2Clients, Participant13, My_city
2 Which string method is used to implement the following:
i. To count the number of characters in the string.
ii. To change the first character of the string in capital letter.
iii. To check whether given character is letter or a number.
iv. To change lowercase to uppercase letter.
v. Change one character into another character.
3 Write a program to check whether a string is palindrome or not
4 WAP a program to reverse a number (without using slicing) and check whether it is a palindrome or not.
5 Rewrite the following for loop into while loop:
for a in range(90, 9, -9):
print a

6 Write a program to input any string and to find the number of words in the string and also print the 5th word.
7 How many times will Python execute the code inside the following while loop? You should answer the question
without using the interpreter! Justify your answers.
i=0
while i < 0 and i > 2 :
print “Hello ...”
i = i+1
8 What is the correct way to add an element to the end of a list in Python?
a. list.add(element) b. list.append(element) c. list.insert(element) d. list.extend(element)

9 What will be the output of print("Welcome To My Blog"[2:6] + "Welcome To My Blog"[5:9])


a. Lcomme b. lcomme T c. lcomme To d. lcomme

10 Which of the following statement(s) would give an error during the


execution of the following code?
R = {'pno':52,'pname':'Virat', 'expert':['Badminton','Tennis'] ,'score':(77,44)}
print(R) #Statement 1
R['expert'][0]='Cricket' #Statement 2
R['score'][0]=50 #Statement 3
R['pno']=50 #Statement 4

a. Statement 1 b. Statement 2 c. Statement 3 d. Statement 4


11 Given the following dictionaries
dict_student = {"rno" : "53", "name" : 'Rajveer Singh'}
dict_marks = {"Accts" : 87, "English" : 65}
Which statement will append the contents of dict_marks in dict_student?
a. dict_student + dict_marks b. dict_student.add(dict_marks)
c. dict_student.merge(dict_marks) d. dict_student.update(dict_marks)

12 Which of the following is not a component of the math module in Python?


a. ceil() b. mean() c. fabs() d. pi
13 What will be the output of the following code?
L=["One , Two", "Three", "Four"]
print(len(L)/2*len(L[0]))

a. 6.5 b. 13 c. 13.5 d. 6.0


14 Rewrite the following code in Python after removing all the syntax errors. Underline each correction done in the
code.
num1, num2 = 10, 45
While num1 % num2 == 0
num1+= 20
num2+= 30
Else:
print('hello')
15 Write a suitable Python statement for each of the following tasksusing built-in functions/methods only:
i To delete an element Mumbai:50 from Dictionary D.
ii To display words in a string S in the form of a list
16 Write a program to take a string and count how many words are starting from a vowel ‘aeiouAEIOU’
17 Write a Python Program to display alternate characters of a stringmy_str.
For example, if my_str = "Computer Science"
The output should be Cmue cec

18 WAP to count the number of digits in a string taken from the user
19 For example, Consider the following dictionary BOOKS
BOOKS = {1:"Python", 2:"Internet Fundamentals ", 3:"Networking ",4:"Oracle sets", 5:"Understanding HTML"}
WAP a program that takes the dictionary BOOKS and displays the names in uppercase of those books whose name
starts with a consonant.
20 What possible output(s) are expected to be displayed on screen at the time of execution of the program from the
following code?
import random
points=[20,40,10,30,15]
points=[30,50,20,40,45]
begin=random.randint(1,3)
last=random.randint(2,4)
for c in range(begin,last+1):
print(points[c],"#")
(a) 20#50#30# (b) 20#40#45 (c) 50#20#40# (d) both (b) and (c)
21 State True or False: “Tuple is datatype in Python which contain data in key-value pair.”
22 Select the correct output of the code:
s='[email protected]'
s=s.split('kv')
op = s[0] + "@kv" + s[2]
print(op)

(A) mail2@kvsangathan (B) mail2@sangathan. (C) mail2@kvsangathan. (D) mail2kvsangathan.


23 (A) Given is a Python string declaration:
message='FirstPreBoardExam@2022-23'
Write the output of: print(message[ : : -3].upper())

(B) Write the output of the code given below:


d1={'rno':25, 'name':'dipanshu'}
d2={'name':'himanshu', 'age':30,'dept':'mechanical'}
d2.update(d1)
print(d2.keys())
24 Predict the output of the Python code given below:
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)
25 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)
Lst.append(t)
print(Lst)
26 Predict the output of the code given below:
s="C++VsPy"
m=""
for i in range(0, len(s)):
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-1]
elif (s[i].isupper()):
m = m + s[i].lower()
else:
m = m +'&'
print(m)
27 What will be the output of the following python program?
str = ""
name = "9@Days"
for x in name:
if x in "aeiou":
str+=x.upper()
elif not x.isalnum():
str+="**"
elif x.isdigit():
pass
else:
str+=x.lower()
print(str)
28 State True or False
i) “Python has a set of keywords that can also be used to declare variables”
ii)
29 Select the correct output of the following python code:
str="My program is program for you"
t = str.partition("program")
print(t)
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')
30 a) What will be the output of the following string operation.
str="PYTHON@LANGUAGE"
print(str[2:12:2])

b) Write the output of the following code.


data = [1,2,4,5]
for x in data:
x = x + 10
print(data)
FUNCTION
31
Write statement to call the function.
def Add():
X = 10 + 20
print(X)
#statement to call the above function
32
Write statement to call the function.
def Add(X,Y):
Z = X+Y
return Z
#statement to call the above function print(“Total =”,C)

What will be the output of following code?


def Cube(n):
print(n*n*n)
Cube(n) # n is 10 here print(Cube(n))
33 What are the different types of actual arguments in function? Give example of any one of them.
34 What will be the output of following code:
def Alter(x, y = 10, z=20):
sum=x+y+z
print(sum)
Alter(10,20,30)
Alter(20,30)
Alter(100)
35 What is Local Variable and Global Variables? Illustrate with example

36 What will be the output of following code?


def display(s):
l = len(s) m=""
for i in range(0,l):
if s[i].isupper():
m=m+s[i].lower()
elif s[i].isalpha():
m=m+s[i].upper()
elif s[i].isdigit():
m=m+"$"
else:
m=m+"*"
print(m)
display("[email protected]")
37 What will be the output of following code?
X = 100
def Change(P=10, Q=25):
global X
if P%6==0:
X+=100
else:
X+=50
Sum=P+Q+X
print(P,'#',Q,'$',Sum)
Change()
Change(18,50)
Change(30,100)
38 What will be the output of following code?
def Fun1(mylist):
for i in range(len(mylist)):
if mylist[i]%2==0:
mylist[i]/=2
else:
mylist[i]*=2
list1 =[21,20,6,7,9,18,100,50,13]
Fun1(list1)
print(list1)
39 What will be the output of following code?
def Total(Number=10):
Sum=0
For C in range(1,Number+1):
if C%2==0:
continue
Sum+=C
return Sum
print(Total(4))
print(Total(7))
print(Total())
40 Function can alter only Mutable data types? (True/False)

*************STAY HEALTHY STAY HAPPY*************

You might also like