You are on page 1of 32

CENTRAL BOARD OF SECONDARY EDUCATION

School Name: Police Modern Sr. Sec. School


Address: Reserve Police Line Mathura
COMPUTER SCIENCE PRACTICAL FILE

A COMPUTER SCIENCE PRACTICAL FILE SUBMITTED TO THE DEPARTMENT OF COMPUTER


SCIENCE FOR THE FULLFILLMENT OF AISSCE EXAMINATION SESSION -2023-24.

SUBMITTED BY : KULJEET NISCHAL

HOD (COMPUTER):

CLASS : 12th

SECTION : B1

ROLL NO : 19
ACKNOWLEDGEMENT

I wish to express my deep sense of


gratitude and indebtedness to our learned teacher
POOJA , COMPUTER SCIENCE, POLICE MODERN
SR. SEC. SCHOOL, MATHURA for his invaluable
help, advice and guidance in the preparation of this
project.

I am also greatly indebted to our


principal Mrs. Richa Vashishth and school
authorities for providing me with the facilities and
requisite laboratory conditions for making this
practical file.

I also extend my thanks to much number of


teachers, my classmates and friends who helped me to
complete this practical file successfully.

[KULJEET NISCHAL]
CERTIFICATE

This is to certify that KULJEET


NISCHAL,

Of Class XII in POLICE MODERN SR. SEC.

SCHOOL, MATHURA has completed the PRACTICAL

FILE during the academic year 2023-24 towards

fulfillment of credit for the COMPUTER

SCIENCE practical evaluation of CBSE and

submitted satisfactory report, as compiled in the

following pages, under my supervision.

Internal Examiner Head of the


Department Signature Signature

External Examiner Principal


signature signature
1. Write a python program to return factorial series up to n numbers
using a function.

def facto():
n=int(input("Enter the number:"))
f=1
for i in range(1,n+1):
f*=i
print(f, end=" ")
facto()

.j
output:
2. Write a python program to accept the username “Admin”
as the default argument and password 123 entered by the user
to allow login into the system.
def user_pass(password,username="Admin"):
if password=='123':
print("You have logged into system")
else:
print("Password is incorrect!!!!!!")
password=input("Enter the password:")
user_pass(password
output:
3: Program to enter two numbers and print the
arithmetic operations like +,-,*, /, // and %.
Output:
4:Python Program to find Perfect Number using For loop
5:Write a program to check if the entered number is armstrong or not
Output:
6: Recursively find the factorial of a natural number.
Output:
7:Python program to Check if element exists in list in Python

lst=[ 1, 6, 3, 5, 3, 4 ]

#checking if element 7 is present

# in the given list or not

=7

# if element present then return

# exist otherwise not exist

if i in lst:

print("exist")

else:

print("not exist")
output:
8.Python program to find smallest number in a list

# Python program to find smallest


# number in a list

# list of numbers
list1 = [10, 20, 4, 45, 99]

# sorting the list


list1.sort()

# printing the first element


print("Smallest element is:", list1[0])
output:
9.Python Program to Find Largest Number in a List
# Python program to find largest
# number in a list

# list of numbers
list1 = [10, 20, 4, 45, 99]

# sorting the list


list1.sort()

# printing the last element


print("Largest element is:", list1[-1])
output:
Program:10

Write a python Program to take input for a number,


calculate and print its square and cube?
a
=
i
n
t
a=int(input("Enter any no "))
(
i
n
b=a*a
p
u c=a*a*a
t
(
"
print("Square = ",b)
E
n
print("cube = ",c)
t
e
r

a
n
y

n
o

"
)
)
b
=
a
*
a
c
=
a
*
a
*
a
p
r
i
n
t
(
"
S
q
a
=
i
n
t
(
i
n
p
u
t
(
"
E
n
t
e
r

a
n
y

n
o

"
)
)
b
=
a
*
a
c
=
a
*
a
*
a
p
r
i
n
t
(
"
S
q
u
a
r
e

"
,
b
)
Program:11

Write a python program to take input for 2 numbers,


calculate and print their sum, product and difference?
a=int(input("Enter 1st no "))
b=int(input("Enter 2nd no "))
s=a+b
p=a*b
if(a>b):
d=a-b
else:
d=b-a
print("Sum = ",s)
print("Product = ",p)
print("Difference = ",d)
Program:12

Write a python program to take input for 2 numbers


and an operator (+ , – , * , / ). Based on the operator
calculate and print the result?
Program:13

Write a python program to take input for a number


and print its factorial using recursion?
Program:14

Write a python program to read a file named


“article.txt”, count and print total alphabets in the file?
Program:15

Write a python program to read a file named “article.txt”, count and


print the following:
(i) length of the file(total characters in file)
(ii)total alphabets
(iii) total upper case alphabets
(iv) total lower case alphabets
(v) total digits
(vi) total spaces
(vii) total special characters

You might also like