0% found this document useful (0 votes)
25 views22 pages

Cs Prac File Class 12

Uploaded by

saiyansh mahajan
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)
25 views22 pages

Cs Prac File Class 12

Uploaded by

saiyansh mahajan
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/ 22

Q1) Write a User-defined function which takes list of numbers as an argument and

returns 2 tuples whose values are printed as odd and even


Output:
Q2) Write a User Defined Function ‘arrange’ which receives list of cities students have
admitted into college. Function creates and prints values of dictionary where name of city is key and
no. of student as values
Output
Q3) Write a program to create a function ‘sum-series’ which takes 2 arguments x and n and return:

n j
∑ xj ! (−1 ) j +1
j=1

Output:
Q4) Create a palindrome function which intakes string and returns Boolean true if palindrome and
false if not
Output:
Q5) Create a function data which intakes dictionary as argument. Structure has name as key and
section and stream a part of tuple as a value. Function returns string of names of study in science
stream
Output
Q6) A list contains name of exam centres where exam can be conducted in North India
(L=[‘Delhi’,’Noida’,’Gurgaon’,’Faridabad’]). WUDF allot which accepts reg no. of user and randonmly
allots of the centre to user. While allotment is created storing no. of students allotted to each center
and value is printed as:

Delhi:3

Noida:1

(take reg no. till 0 is entered)


Output:
Q7) User enters upper and lower limit and gets 6 chances to play. Each time user is supposed to
enter a random no.(range is specified by user if no. matches no. generated by computer. User earns
coins as following format:

N*(U.L-L.L)
Output:
Q8) Create a function compile which intakes dictionary with following structure as value {name:
[EL,CL,LL]}. The function changes the value of dictionary of adding paycut for their employees whose
total leaves are more than 20. The dictionary is returned and output is printed.
Output:
Q9) Assume a file ‘Citation.txt’ is created for you. From the file create another file ‘toggle.txt’ where
contents are toggled & display one file after the other.

Output:
Q10) WAP to create a file with following operation using UDF- 1)Add 2)Search by rating
3)Modify(name) 4)Remove(name) 5)Display all 6)Exit

(data is stored as hulk#fiction#***)


Output:
Q11) WAP to create a menu driven program with following options: 1)add 2)display all 3)search by
name 4)list 5)exit
Output:

You might also like