XII File Programmeidkdnd

You might also like

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

XII File Programme 2023-2024

Topic Question
1 Pattern Read a list and print as follows:
Let the list is [1,5,7,8]
Output:
1
55
777
8888

2 List Input a list of numbers and test if a number is equal to the sum of the cubes of its
digits. Find the smallest such numbers.
3 String Read a line and capitalize the first and last letter of each word.

4 Tuple Create a tuple to store the first 9 terms of Fibonacii series.


5 Dictionary Create a dictionary containing names and telephone numbers of some students with
name as key and telephone number as value. Enter a name and search whether it is
present in the dictionary or not. If present then store it along with the telephone
number in a list and display the list. Otherwise display “not found”.
6 Function 1 Assign a sentence and do as follows using built in functions:
i) Replace the first word that has three letters with ***
ii) Search and split the sentence according to a specific string
7 Function 2 Define a function Change (N) where N is a list of integers to decrease the value of
even position by 2 otherwise increase the value by 1.

8 Function 3 Define a function my_pow() with x and n as parameters. It calculates the value of
xn. In case of absence of the value of n during function call, instead of showing
error it will calculate the value of x2.

9 Function 4 Implement binary search technique using a recursive function

10 Function 5 Enter ten different numbers in a tuple. Pass the tuple to a function to arrange in
ascending order using bubble sort technique. Take necessary assumptions if
required.
11 Modules In the game of tossing a coin, you want to know the number of times you get
“Head” and “Tail”. You keep the record as “1” for getting “head” and “0” for
“Tail”. Write a programme to perform the above task assuming that you have
tossed a coin for 10 times in this game.
12 Exception Write a program to print the reciprocal of a number. Any kind of possible error
Handling should be handled.

13 SQL Write SQL statements to –


1. Create a database ‘shop’ in MySQL system and do as follows:
2. Create the following two tables under shop as follows:

3. To display the ItemNo of all items in the STOCK table in descending order of
quantity.
4. To insert a new record without UnitPrice and StockDate as follows :
(5010, ‘Classic Note Book’, 102, 120)
5. To display the name and unitprice of those items whose dealer code is 103 or
quantity in stock is more than 150 from STOCK table.
6. To display average UnitPrice of items for each dealer individually as per Dcode
from the STOCK table.
7. To add a new column Phone with 10 characters in Dealers table.
8. To display the Item No of those item names that contain ‘C/c’.
9. To display UnitPrice of Item No 5004 and 5005.
10. To create a view to store ItemNO, Qty and dealers name.
11. To increase the Qty of item Eraser by 10.
12. Remove the record of 5010.
Give the output of the following SQL queries :
13. Select Count(Distinct Dcode) From Stock;
14. Select Qty*Unitprice From Stock Where Stockdate=’01-Jan-09’;
15. Select Min(Stockdate) From Stock;

You might also like