0% found this document useful (0 votes)
17 views56 pages

Prac File For Prateek

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

Prac File For Prateek

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

CS Practical File

NAME – PRATEEK SINGH


CLASS -- XII A
0|Page
Write a program that reads a line and prints its
frequency chart like
. Number of uppercase letters
. Number of lowercase letters
. Number of alphabets
. Number of digits

Write a program to find the second largest


element in a list “Num”.

1|Page
Write a program to read a list of elements. Input
an element from the user that has to be inserted
in the list. Also, input the position at which
it is to be inserted. Apply a built-in function

2|Page
to insert the element at the desired position in
the list.

Write a program to read a list of elements.


Modify this list so that it does not contain any
duplicate elements i.e., all elements occurring
multiple times in the list should be deleted and
only their first occurrences should be displayed
in the final list.

3|Page
• Write an interactive program to create an
integer list of 8 integers and sort the list
in ascending order using bubble sort method

4|Page
5|Page
Write a python program to shift each element of
a list to the right so that the last element
becomes the first element. For example, the
given list:

6|Page
Write a Python code to store ‘n’ number of
subjects in a tuple.

Write a program to print all the elements of a


tuple in the reverse order.

7|Page
Write a program to input n numbers from the user,
store these numbers in a tuple and print the
maximum, minimum number along with the sum and
mean of all the elements from this tuple.

8|Page
Program to perform linear search on a tuple of
numbers.

Write a Python program to input any two tuples


and swap their values.

9|Page
10 | P a g e
Write a program to input total number of sections
and stream name in 11th class and display all
information on the output screen.

WAP to store students’ information like


admission number, name and marks in a dictionary
and display information on the basis of
admission number.

11 | P a g e
12 | P a g e
Write a program to enter names of employees and
their salaries as input and store them in a
dictionary.

Write a program to count the number of times a


character appears in a given string using a
dictionary.

13 | P a g e
Program to find the sum of the series:
▪ s = 1+x2+x3+x4…+xn

14 | P a g e
Illustrating the working of break statement.

Write a python script to calculate the sum of


the following series:
• S = (1)+(1+2)+(1+2+3)+……+(1+2+3+….+n)

• To calculate and display the factorial of an


inputted number.

15 | P a g e
16 | P a g e
DATA HANDLING

TEXT FILE
# PRACTICAL IMPLEMENTATION 1:

#OUTPUT:

# PRACTICAL IMPLEMENTATION 2:

17 | P a g e
# OUTPUT:

# PRACTICAL IMPLEMENTATION 3:

18 | P a g e
#OUTPUT:

# PRACTICAL IMPLEMENTATION 4:

# OUTPUT:

19 | P a g e
# PRACTICAL IMPLEMENTATION 5:

# OUTPUT:

# PRACTICAL IMPLEMENTATION 6:

# OUTPUT:

20 | P a g e
# PRACTICAL IMPLEMENTATION 7:

# OUTPPUT:

# PRACTICAL IMPLEMENTATION 8:

21 | P a g e
# OUTPUT:

# PRACTICAL IMPLEMENTATION 9:

# OUTPUT:

22 | P a g e
# PRACTICAL IMPLEMENTATION 10:

# OUTPUT:

# PRACTICAL IMPLEMENTATION 11:

# OUTPUT:

23 | P a g e
# PRACTICAL IMPLEMENTATION 12:

BINARY FILE
PRACTICAL IMPLEMENTATION 13:

# OUTPUT:

# PRACTICAL IMPLEMENTATION 14:

24 | P a g e
# OUTPUT:

# PRACTICAL IMPLEMENTATION 15:

# OUTPUT:

# PRACTICAL IMPLEMENTATION 16:

# OUTPUT:

25 | P a g e
# PRACTICAL IMPLEMENTATION 17:

# OUTPUT:

# PRACTICAL IMPLEMENTATION 18:

# OUTPUT:

26 | P a g e
# PRACTICAL IMPLEMENTATION 19:

# OUTPUT:

27 | P a g e
# PRACTICAL IMPLEMENTATION 20:

28 | P a g e
29 | P a g e
# PRACTICAL IMPLEMENTATION 21:

# OUTPUT:

30 | P a g e
CSV FILE
PRACTICAL IMPLEMENTATION 22:

# OUTPUT:

31 | P a g e
# PRACTICAL IMPLEMENTATION 23:

# OUTPUT:

# PRACTICAL IMPLEMENTATION 24:

# OUTPUT:

32 | P a g e
# PRACTICAL IMPLEMENTATION 25:

# OUTPUT:

# PRACTICAL IMPLEMENTATION 26:

33 | P a g e
# PRACTICAL IMPLEMENTATION 27:

# OUTPUT:

# PRACTICAL IMPLEMENTATION 28:

# OUTPUT:

34 | P a g e
# PRACTICAL IMPLEMENTATION 29:

# OUTPUT:

35 | P a g e
CH-
# PRACTICAL IMPLEMENTATION:

# OUTPUT:

# PRACTICAL IMPLEMENTATION:

# OUTPUT:

36 | P a g e
# PRACTICAL IMPLEMENTATION:

# OUTPUT:

# PRACTICAL IMPLEMENTATION:

# OUTPUT:

37 | P a g e
# PRACTICAL IMPLEMENTATION:

#OUTPUT:

# PRACTICAL IMPLEMENTATION:

38 | P a g e
# OUTPUT:

# PRACTICAL IMPLEMENTATION:

# OUTPUT:

39 | P a g e
# PRACTICAL IMPLEMENTATION:

# OUTPUT:

# PRACTICAL IMPLEMENTATION:

40 | P a g e
# OUTPUT:

# PRACTICAL IMPLEMENTATION:

# OUTPUT:

41 | P a g e
DATA STRUCTURES IN
PYTHON
# PRACTICAL IMPLEMENTATION:

42 | P a g e
# OUTPUT:

# PRACTICAL IMPLEMENTATION:

43 | P a g e
# OUTPUT:

# PRACTICAL IMPLEMENTATION:

44 | P a g e
# OUTPUT:

45 | P a g e
# PRACTICAL IMPLEMENTATION:

Q. Display the sum of all loan amounts whose interest


rate is greater than 10.

46 | P a g e
Q. Display the maximum interest from loans table.

Q. Display the count of all loan holders whose


interest rate is null.

# PRACTICAL IMPLEMENTATION:

Q. Mr. vinay wanted to display avg salary of each


category. He wanted the following SQL statement.
Identify error(s)and rewrite the correct SQL
statement.

47 | P a g e
# PRACTICAL IMPLEMENTATION:

Q. To display the details of those clients whose city


is Delhi.

48 | P a g e
Q. To display the details of those products whose
name ends with ‘wash’.

49 | P a g e
# PRACTICAL IMPLEMENTATION:

Q. To display of all models in the model table in


ascending order of date of manufacture.

Q. To display details of those models manufactured in


2011 and whose cost is below 2000.

50 | P a g e
Q. To display the model_id, comp_id, cost from the
table model, compname and contactperson from company
table, with their corresponding comp_id.

# PRACTICAL IMPLEMENTATION:

51 | P a g e
Q. what will be the output of the following?
Select * from bank_account natural join branch;

# PRACTICAL IMPLEMENTATION:

Q. insert the following data into the attributes


itemno, itemname and scode respectively in the given
table store. Itemno = 2010, itemname = ‘notebook’ and
scode = 25.

Q. Now Abhay wants to display the structure of the


table store, i.e., name of the attributes and their
respective data types that he has used in the table.
Write the query to display the same .

52 | P a g e
# PRACTICAL IMPLEMENTATION:

Q. Write SQL query to display Productname and price


for all products whose price is in the range 50 to
150.

53 | P a g e
Q. write sql query to display details of products
whose manufacturer is either XYZ or ABC.

# PRACTICAL IMPLEMENTATION:

Q. To display the clientname and city of all Mumbai


and delhi based clients in client table.

54 | P a g e
Q. increase the price of all the products in product
table by 10%.

55 | P a g e

You might also like