Practical File Index Class 12 Python 2024-25

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

S

N
1.
INDEX QUESTION

WAP to enter a string and check whether the string is palindrome or not.
2. WAP to enter a sentence (string) and display the smallest word.
3. WAP to enter a sentence (string) and display the longest word.
4. WAP to enter a sentence (string) and convert it into title case.
For ex: If user inputs : python is fun
Then : Outputs should be : Python Is Fun
5. WAP to enter n integer elements in a Tuple and check whether all the
elements are in ascending order or not.
6. WAP to enter n integer elements in a Tuple and display the second highest
element.
7. WAP to create a nested tuple of n elements where each element of nested
tuple contains RN, NAME AND MARKS.
For example T=((1,"RAHUL",99.9),(2,"ROHIT",100))

8. WAP to enter a key and display the corresponding value stored in a


Dictionary, if key does not exists then write appropriate message "key does
not exist"
9. WAP to enter elements (name: marks) in a Dictionary and update the value
of particular key entered by user.
10 WAP to enter elements (name: marks) in a Dictionary and count the students
. whose marks is >90.
11 WAP to enter elements (name: marks out of 500) in a dictionary and display
. the students whose name starts with A.
12 WAP to enter n elements (name: marks) in a dictionary and delete the
. element whose key is entered by user.
13 WAP to enter n elements (name: marks out of 500) in a Dictionary and delete
. all the elements whose percentage is <90.
14 WAP to enter n elements (name: marks out of 500) in a dictionary and delete
. all the elements whose percentage is <90, also store all the deleted
elements in another dictionary and display them.
15 WAP (USING FUNCTION) to enter a number and display its factorial.
.
16 WAP (USING FUNCTION) to enter a number and check whether the number is Prime
. or not.
17 WAP (USING FUNCTION) to enter a number and check whether the number is
. Perfect or not.
18 WAP (USING FUNCTION) to enter a number and reverse the number.
.
19 WAP (USING FUNCTION) to enter a number and check whether the number is
. Palindrome or not.
20 WAP (USING FUNCTION) to enter a number and check whether the number is
. Armstrong number or not
21 WAP (USING FUNCTION) to enter 10 elements of Integer type and display the
. greatest element.
22 WAP (USING FUNCTION) to enter N elements of integer type in a list and search an
. element using linear search.
23 WAP (USING FUNCTION) to enter N elements of integer type in a list and Search
. an element using binary search.
24 WAP (USING FUNCTION) to enter N elements of integer type in a list and rearrange
. the elements as per the following
if input list L1 contains
3 7 9 6 10 8 14 5 4 12
Then output list L1 should contain the following
7 3 6 9 8 10 5 14 12 4
25 WAP (USING FUNCTION) to enter N elements of integer type in a list and rearrange
. the elements as per the following
if input list L1 contains
3 7 9 6 10 8 14 5 4 12
Then output list L1 should contain the following
8 14 5 4 12 3 7 9 6 10
26 WAP (USING FUNCTION) to enter N elements of integer type in a list and rearrange
. the elements as per the following
if input list L1 contains
3 7 9 6 10 8 14 5 4 12
Then output list L1 should contain the following
12 4 5 14 8 10 6 9 7 3
27 WAP (USING FUNCTION) to enter N elements of integer type in a list and rearrange
. the elements as per the following
if input list L1 contains
3 7 9 6 10 8 14 5 4 12
Then output list L1 should contain the following
6 14 18 18 30 24 42 10 12 36
28 WAP (USING FUNCTION) to enter N elements of integer type in a list and rearrange
. the elements as per the following
if input list L1 contains
3 7 9 6 10 8 14 5 4 12
Then output list L2 should contain the following
3 7 9 5 12 4 14 8 10 6
29 WAP (USING FUNCTION) to enter N elements of integer type in a list and rearrange
. the elements as per the following
if input list L1 contains
3 7 9 6 10 8 14 5 4 12
Then output list L2 should contain the following
3 7 9 5 6 10 8 14 4 12
30 WAP (USING FUNCTION) to enter N elements of integer type in a list and rearrange
. the elements as per the following
if input list L1 contains
3 7 9 6 10 8 14 5 4 12
Then output list L1 should contain the following
7 9 5 6 10 8 14 4 12 3
31 WAP (USING FUNCTION) to enter N elements of integer type in a list and rearrange
. the elements as per the following
if input list L1 contains
3 7 9 6 10 8 14 5 4 12
Then output list L1 should contain the following
12 3 7 9 6 10 8 14 5 4
36 Write a menu driven program to perform following operation on a text file “abc.txt”
.
1. Create a file and store information into the file.
2. Read and display all the characters in the file
3. Read and display all the word in the file
4. Read and display all the word starting with A in the file
37 Write a menu driven program to perform following operation on a text file “abc.txt”
.
1. Create a file and store information into the file.
2. Read and display all the lines in the file
3. Read and display all the lines starting with A in the file
4. Read and display all the lines ending with a in the file
5. Read and display all the lines containing ‘a’ in the file
38
. Write a menu based program to perform the following operation on a binary file
"stud.dat"
1. Add new record
2. Display all the record
3. Update record based on Roll No.

The information of students contain following data

RN of integer type

NAME of string type


Marks of float type; # marks will be entered out of 500
39
. Write a menu based program to perform the following operation on a binary file
"stud.dat"
1. Add new record
2. Display information of all the students whose percentage is b/w 90 to 95

3. Display information of all the students whose Name starts with A

The information of students contain following data

RN of integer type

NAME of string type


Marks of float type; # marks will be entered out of 500
40
. Write a menu based program to perform the following operation on a binary file
"item.dat"
1.Add new item

2.Display all the items


3.Delete the information of the items based on item name

The information of items contain following data

item_no of integer type

item_name of string type


item_price of float type
41
. Write a menu based program to perform the following operation on a csv file
"books.csv"
1.Add new book

2.Display all the books


3.Search the information of the book based on book_id
4.Search the information of the book based on book_name

The information of books.csv contain following data

book_id of integer type

book_name of string type


book_price of float type
42
. Write a menu based program to perform the following operation on a csv file
"books.csv"
1.Add new book

2.Display all the books


3.delete the information of the book based on book_id
4.update the information of the book based on book_id

The information of books.csv contain following data


book_id of integer type

book_name of string type


book_price of float type

43
. Write a menu based program to perform the following operation on Customer Details
using Interfacing Python with MySQL

1. Add new record


2. Display all the record
3. Search record based on Cust_Id
Customer table has following structure
Cust_id Integer Type
Cust_name varchar Thpe
Cust_age Integer Type
DOB date Type
Outstanding Amount float type
44
. Write a menu based program to perform the following operation on Customer Details
using Interfacing Python with MySQL
1. Add new record
2. Display all the records
3. Update record based on Cust_Id

Customer table has following structure


Cust_id Integer Type
Cust_name varchar Thpe
Cust_age Integer Type
DOB date Type
Outstanding Amount float type
45
. Write a menu based program to perform the following operation on Customer Details
using Interfacing Python with MySQL.
1. Add new record
2. Display all the record
3. Delete record based on Cust_Id

Customer table has following structure


Cust_id Integer Type
Cust_name varchar Thpe
Cust_age Integer Type
DOB date Type
Outstanding Amount float type
46
. Write a menu based program to perform the following operation on Book Details
using Interfacing Python with MySQL.
1. Add new record
2. Display all the record
3. Update record based on Book_Id

Book table has following structure


Book_id Integer Type
Book_name varchar Thpe
Price Float Type
Qty Integer Type
47
. WAP to enter N elements of integer type in a Linear List and sort the elements using
1) Bubble Sort
2) Selection Sort
48
. WAP to enter N elements of integer type in a Linear List and an element of integer
type and
check whether the list contains that element or not
49
. WAP to enter N elements of integer type in a Linear List and an element of integer
type
and count the occurrence of the element
50
. WAP to enter N elements in a List and insert an element at a specific position
51
. WAP to enter N sorted elements and insert an element at appropriate position
52
. WAP to enter N element in a List and delete an element from a specific position
53
. WAP to enter N element in a List and delete an element
54
. WAP to delete all the occurrence of the number in a list
55
. WAP to create a nested linear list
56
. WAP to create nested linear list and access specific elements in list
57
. WAP to create a 2D Linear List (input and output all the elements in 2D List)
58 Write a menu driven program to perform the following operations in a Linear List
. using
Stack.
1.Push
2.Pop
3.Display
59 Write the SQL commands for (i) to (v) on the basis of tables following tables
.
(Create Tables using proper keys and insert the rows as specified)

WORKER
W-ID FIRSTNAME LASTNAME ADDRESS CITY
102 Sam Tones 33 Elm St. Paris
105 Sarah Ackerman 440 U.S New York
144 Manila Sen Friends New York
colony
210 George Smith First Street Howard

DESIG
W-IS SALARY BENEFITS DESIGNATION
102 75000 15000 MANAGER
105 85000 25000 DIRECTOR
144 70000 15000 CLERK
210 50000 12000 CLERK

(i) To display the information of those employees living in NewYork from

EMPLOYEES table.

(ii) To display the Maximum salary of Clerks from the table desig, where Total
Salary is calculated as Salary + Benefits.

(iii) To display list of Designations.

(iv) To decrease the benefits from DESIG. Table by 1000.

(v) To display designation and total salary of each Designation.

60 Write the SQL commands for (i) to (v) on the basis of tables following tables
.
(Create Tables using proper keys and insert the rows as specified)
Table: BOOKS
Book_I BookNam AuthorNa Publishe Price Qty
D e me r
L01 Maths Raman ABC 70 20
L02 Science Agarkar DEF 90 15
L03 Social Suresh XYZ 85 30
L04 Computer Sumita ABC 75 7
L05 Telugu Nannayya DEF 60 25

Table: ISSUES
Book_ID Qty_Issued
L02 13
L04 5
L05 21

(i) To show Book name, Author name and Price of books of ABC publisher.

(ii) To display the details of the books in descending order of their price.

(iii) To display the Book Id, Book name, Publisher, Price, Qty, Qty_Issued

from both the tables with their matching Book ID.

(iv) Display minimum price of each publisher with their name.

(v) Display the price of only those books where Qty_issued is 5.


61 Write the SQL commands for (i) to (v) on the basis of tables following tables
.
(Create Tables using proper keys and insert the rows as specified)

Table: FURNITURE

NO ITEM TYPE PRICE Discou


NAME nt
1 White Double 30000 25
lotus Bed
2 Pink Baby cot 7000 30
feather
3 Dolphin Office 9500 35
Table
4 Decent Double 25000 15
Bed
5 Comfort Sofa 3500 25

Table: ARRIVAL
NO ITEM NAME TYPE PRICE DISCOUN
. T
11 Wood comfort Double Bed 25000 25
12 Old Fox Sofa 17000 20
13 Micky Baby Cot 7500 15

(i) To show all information about the Baby cots from the FURNITURE table.

(ii) To display the details of the furniture by ITEM NAME in ascending order.

(iii) Display total price of “Double Bed”

(iv) Display minimum discount of arrival items.

(v) To decrease the price of arrival item by 2000.


62 Consider the following tables GAMES and PLAYER. Write SQL commands for the
.
statements (i) to (v)

(Create Tables using proper keys and insert the rows as specified)
GAMES
GCode GameNam Num PrizeMone
e y
101 CaromBoa 2 5000
rd
102 Badminton 2 12000
103 TableTenni 4 8000
s
104 Chess 2 9000
105 LawnTenni 4 25000
s

PLAYER
PCode Name GCode
1 Arjun 101
2 Ravi 105
3 Jignesh 101
4 Nihir 103
5 Sohil 104

i). To display the name of players who plays CaromBoard.


ii). To display details of those game which are having PrizeMoney more than
8000.
iii). Display Total No. of Grames;
iv). Increase the PrizeMoney by 1000 who is having Prize Money Less than 8000.
v). Arrange the records of PLAYER table in descending order by GCode.
63 Consider the following tables TEACHER and QUALIFICATION. Write SQL commands
.
for the statements (i) to (v)
TEACHERS
TCode TeacherNam subject salary
e
101 Priya Hindi 5000
102 Sonia English 12000
103 Anupama Computer 8000
104 Pinki English 9000
105 Isha computer 25000

QUALIFICATION
QCode Qualification TCode
1 MA 101
2 BBA 105
3 MCA 101
4 B.ED 103
5 MA 104

i). To display the name of Teacher whose qualification is’ MA’


ii). To display details of those teachers which are having Salary more than 8000.
iii). Display Total No. of teachers;
iv). Decrease the Salary by 1000 who is having salary Less than 8000.
v). Display the total no. of teacher in each subject with their subject.

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