0% found this document useful (0 votes)
6 views9 pages

Class_12_Practical_File_Updated

Uploaded by

memej17816
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)
6 views9 pages

Class_12_Practical_File_Updated

Uploaded by

memej17816
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/ 9

COMPUTER SCIENCE

PRACTICAL FILE (2024-2025)

NAME: ADARSH

CLASS: 12th A

ROLL NO: _____

SUBJECT TEACHER: MRS. RANI SALONI


Acknowledgement

I would like to express my gratitude to my Computer Science teacher, Mrs. Rani Saloni, for her able

guidance and support in completing my project. I would also like to extend my gratitude to the

honorable Principal, Mrs. Nimmi, who gave me the golden opportunity to complete this project.
Certificate

This is to certify that ADARSH, a student of class XII-A of Nav Uday Convent Senior Secondary

School, has successfully completed his Python programming project under the guidance and

supervision of Mrs. RANI SALONI, his Computer Science teacher.

Teacher's Signature
INDEX

1. 1. Calculate the area and perimeter of a rectangle

2. 2. Find the square root of a number

3. 3. Check if a number is even or odd

4. 4. Count the frequency of characters in a string

5. 5. Reverse a string using a function

6. 6. Merge two dictionaries

7. 7. Calculate the sum of a list using recursion

8. 8. Create and search data in a CSV file

9. 9. Check if a number is an Armstrong number

10. 10. Perform basic CRUD operations on a database


Program 1: Calculate the area and perimeter of a rectangle

# Program to calculate area and perimeter of a rectangle

length = float(input("Enter the length of the rectangle: "))

breadth = float(input("Enter the breadth of the rectangle: "))

area = length * breadth

perimeter = 2 * (length + breadth)

print("Area of the rectangle:", area)

print("Perimeter of the rectangle:", perimeter)


Program 2: Find the square root of a number

# Program to find the square root of a number

import math

number = float(input("Enter a number: "))

sqrt = math.sqrt(number)

print("The square root of", number, "is", sqrt)


Program 3: Check if a number is even or odd

# Program to check if a number is even or odd

number = int(input("Enter a number: "))

if number % 2 == 0:

print("The number is even.")

else:

print("The number is odd.")


Program 4: Count the frequency of characters in a string

# Program to count the frequency of characters in a string

string = input("Enter a string: ")

frequency = {}

for char in string:

frequency[char] = frequency.get(char, 0) + 1

print("Character frequency:", frequency)


Program 5: Reverse a string using a function

# Program to reverse a string using a function

def reverse_string(s):

return s[::-1]

string = input("Enter a string: ")

print("Reversed string:", reverse_string(string))

You might also like