You are on page 1of 30

COMPUTER SCIENCE PRACTICAL FILE

NAME:
MAYANK SHARMA
CLASS:
XI
SECTION:
A
ROLL NO:

Teacher’s signature
INDEX (TERM 1)
S.NO PROGRAMS REMARK
Program:1 Write a program in
python to input marks in
5 subjects from the user
and display the average
marks.
Program:2 Write a program in
python to read details like
name, class, age of a
student and then print
the details firstly in same
line and then in separate
lines.
Program:3 Write a program in
python to input a number
and print its first five
multiples
Program:4 Write a program to read a
number n and print n2, n3
and n4
Program:5 Write a program that
generates the
following output: 5 @
10 @9
Program:6 Write a program in
python to input P, R and T
from the user and
calculate the Simple
interest.
Program:7 Write a program in
python to input side
of the square from
the user and display
its perimeter
Program:8 Write a program in
python to input quantity
and price per item from
the user and calculate the
total amount
Program:9 Write a program to
input radius of a circle
from the user and
display area of circle.
Program:10 Write a program to
calculate compound
interest.
Program:11 11. Write a program in
python to calculate area
of triangle, rectangle and
square.
Program:12 12. Write a program in
python to input a string
and print the pattern   
like this:
     t
     t o
     t o d
     t o d a
     t o d a y
Program:13 13. Write a program in
python to count the
number of digits,
uppercase and lowercase
letters in a string.
Program:14 Write a program to check
whether a given string is
palindrome or not.
Program:15 The marks obtained by a
student in computer
science is input by the
user. Your program
should display the grade.
The student gets a grade
as per the following rules:
marks Grade
90-100 A
80-89 B
70-79 C
60-69 D
0-59 F
Program:16 Program calculates the
sum of numbers entered
by the user using while
loop.

Program:17 17. program prints pattern


1 2 3 4 
1 2 3 4 
1234
Using nested for loop.
Program:18 Write a program that
accepts a number from the
user and calculate the
factorial of that number

Program:19 Write a program to obtain


the first 10 numbers of a
Fibonacci sequence. In a
Fibonacci sequence the
sum of two successive
terms gives the third term.

Program:20   Write an if-else


statement that assigns 0
to the variable b, if the
variable a is less than 10.
Otherwise, it should
assign 99 to the variable
b.
PROGRAMS

1. Write a program in python to input marks in 5 subjects


from the user and display the average marks.

OUTPUT:
2. Write a program in python to read details like name, class,
age of a student and then print the details firstly in same
line and then in separate lines.

3. Write a program in python to input a number and print its


first five multiples.

OUTPUT:
4. Write a program to read a number n and print n2, n3 and n4

OUTPUT:

5. Write a program that generates the following output:


5 @ 10 @9

OUTPUT
6. Write a program in python to input P, R and T from the
user and calculate the Simple interest.

OUTPUT

7. Write a program in python to input side of the square


from the user and display its perimeter and area.

OUTPUT:
8. Write a program in python to input quantity and price
per item from the user and calculate the total amount.

OUTPUT

9. Write a program to input radius of a circle from the user


and display area of circle.

OUTPUT
10. Write a program to search an element from the
list ,if exists, display message “element found” else
display “element not found”

OUTPUT:

11. Write a program to calculate compound interest.


OUTPUT:

12. Write a program in python to calculate area of


triangle and rectangle.

(1)
(2)

12. Write a program in python to input a string and print the


pattern like this:
     t
     t o
     t o d
     t o d a
     t o d a y
OUTPUT

13. Write a program in python to count the number of digits,


uppercase and lowercase letters in a string.
14. Write a program to check whether a given string is
palindrome or not.

OUTPUT
15. The marks obtained by a student in computer science is input by the
user. Your program should display the grade. The student gets a grade
as per the following rules:
marks Grade
90-100 A
80-89 B
70-79 C
60-69 D
0-59 F

OUTPUT
16.Program calculates the sum of numbers entered by the user using
while loop.

OUTPUT

17. Program prints pattern


1 2 3 4 
1 2 3 4 
1234
Using nested for loop.

OUTPUT
18. Write a program that accepts a number from the user and calculate
the factorial of that number. The factorial of an integer n is defined as
n ! = n ( n - 1)( n - 2)( n - 3) ... (3)(2)(1) ; if n>0
For example, 5! = 5 x 4 x 3 x 2 x 1
Using while loop.

OUTPUT
19. Write a program to obtain the first 10 numbers of a Fibonacci
sequence. In a Fibonacci sequence the sum of two successive terms
gives the third term.
Following are the first 10 terms of the Fibonacci sequence:
0 1 1 2 3 5 8 13 21 34

OUTPUT
20. Write an if-else statement that assigns 0 to the variable b, if the
variable a is less than 10. Otherwise, it should assign 99 to the variable
b. 

OUTPUT
TERM 2
INDEX (TERM 2)
S.NO PROGRAMS REMARKS
Program:1 1. Write a Program in
python to find the
common elements in
two tuples using IN and
then display the tuple.
Program:2 2. Write a program to
search an element
from the    list ,if exists,
display message
“element found” else
display “element not
found”
Program:3 3. Program to create a
dictionary to enter the
marks of a student and
then display total
marks and average.

Program:4 4. Program to create


two lists from
dictionary, one having
the keys of the
dictionary and other
having the values of
the dictionary.

Program:5 5. Create a dictionary


which stores the states
and its capital.
Program:6 6. program to count
the frequency of items
in a list using dictionary
Program:7 7. Program to find the
maximum value in a
dictionary.

Program:8 8. Program to read and


display a list.

Program:9 9. Program to find a


particular element in a
list.

Program:10 10. Program to delete


all 0’s from the list.

Program:11 11. Program to print


different list in
different lines.

Program:12 12. Program to find a


key, if not found, print
the message “key not
found”.

Program:13 13. Program of odd and


even list.

Program:14 14. Write a program to


create a tuple with
mixed data type and 
create a tuple with
repetition.

Program:15 15. Write a program to


concatenate two tuple
PROGRAMS
1. Write a Program in python to find the common elements in two
tuples using IN and then display the tuple.

OUTPUT
2. Write a program to search an element from the    list, iif
exists, display message “element found” else display “element
not found”

OUTPUT

3. Program to create a dictionary to enter the marks of a


student and then display total marks and average.

OUTPUT
4. Program to create two lists from dictionary, one having the
keys of the dictionary and other having the values of the
dictionary.

OUTPUT

5. Create a dictionary which stores the states and its capital.


6. Program to count the frequency of items in a list using
dictionary

OUTPUT

7. Program to find the maximum value in a dictionary.


8. Program to read and display a list.

9. Program to find a particular element in a list.

OUTPUT
10. Program to delete all 0’s from the list.

OUTPUT

11. Program to print different list in different lines.

OUTPUT
12. Program to find a key, if not found, print the message “key
not found”.

13. Program of odd and even list.

OUTPUT
14. Write a program to create a tuple with mixed data type
and create a tuple with repetition.

OUTPUT

15. Write a program to concatenate two tuples.

You might also like