Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
21 views
23 pages
Harsh CS
Computer science art integration
Uploaded by
himanshubby
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save Harsh CS For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
21 views
23 pages
Harsh CS
Computer science art integration
Uploaded by
himanshubby
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save Harsh CS For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save Harsh CS For Later
You are on page 1
/ 23
Search
Fullscreen
PRACTICAL FILE OF COMPUTER SCIENCE (083) SESSION 2024-25 BY HARSH JAISWAL (12103) UNDER GUIDANCE OF MRS. POOJA SINGH BAGHEL FOR PARTIAL FULFILMENT OF XII SCI. SUBMITTED TO BAL BHARATI PUBLIC SCHOOL NTPC SIPAT, BILASPURCERTIFICATE This is to certify that Harsh Jaiswal of class XII has successfully completed the practical work with the help of Python and SQL language under my guidance and supervision. | am satisfied with his initiatives and efforts in completing the practical work, as a part of the CBSE curriculum for class XIl examination. Mrs. P.S. BAGHEL Mr. SHALABH NIGAM Internal Examiner (Principal)ACKNOWLEDGMENT lam greatly indebted to my Teacher Mrs. Pooja Singh Baghel for her effervescent encouragement and constructive guidance. | would like to express my gratitude to her for making me proficient in learning and understanding Python and helping me a lot in completing my work and assignment. | also give thanks to respected principal sir, Mr. Shalabh Nigam without whose cooperation this practical work wouldn’t have been completed. | am heartedly thankful to my parents, my family and my classmates who helped me through my work.1. Write a program to check whether a number is palindrome or not using a user-defined function. def palindrome (number: if (number==number[::-1]): return "The number is apalindrome." else: return "The number is not apalindrome." no=input ("Enter number: ") print (palindrome (no) ) ourput Enter number: 121 The number is apalindrome. 2. Write a program to modify the given list, even numbers of a list must be increased by 5 and odd numbers must be decreased by 5, using a user-defined function. A= GE) Dy 3; 4p. Syn Ge A 8) def oddeven(1): result = [] for i inl: if it2==0: result.append(i + 5) else: result.append(i - 5) return result print (oddeven(1)) ourPuT [-4, 7, -2, 9, 0, 11, 2, 13]3. Write a menu-driven program in Python using user-defined function to find. e Simple interest Compound interest Get gimple_interest (principal, rate, time): ‘Calculate and return Simple interest.""" return (principal * rate * time) / 100 def compound interest (principal, rate, time, 1 ‘Calculate and return Compound Interest. return principal * ((1 + rate / (100 * m)) ** (n * time) ~ principal der main): while True: print ("\nMenu:") Print("1. Calculate simple Interest”) print ("2. calculate Compound interest”) print ("3. Exit") choice = input ("Enter your choice (1/2/3): ") Af choice == 11" principal = float (input ("Enter the principal amount: ")) Fate = float (input ("Enter the rate of interest (in 4): ")) time = float (input ("Enter the time (in years): ")) siv= simple interest (principal, rate, time) print ("The Simple interest is:'*,si) elif choice == 12": Principal = float (input ("Enter the principal amount: *)) Fate = float (input ("Enter the rate of interest (in #): ")) time = float (input ("Enter the time (in years): ")) n= int (input ("Enter the number of tines interest is compounded per year: ")) ‘ci = compound_interest (principal, rate, time, n) print ("The Compound Interest is:'*,ci) elif choice == 13" print ("Exiting the program. Goodbye!") Break eis: print ("invalid choice! Please try again.") Af name = "_main_’ Tain (7 ourPuT Menu: 1. calculate simple Interest 2. Calculate Compound Interest 31 exit Enter your choice (1/2/3): 1. Enter the principal amount: 7000 Enter the rate of interest (in $): 8 Enter the time (in years): 3 ‘The Simple Interest is: 1680.0 Menu: 1. calculate simple Interest 21 calculate Compound Interest 3. Exit Enter your choice (1/2/3): 2 Enter the principal amount: 7000 Enter the rate of interest (in $): 8 Enter the time (in years): 3 Enter the number of times interest is compounded per year: 1 ‘The Compound Interest is: 1817.9840000000004 Menu: 1. Calculate simple Interest 21 calculate Compound Interest 3. Exit Enter your choice (1/2/3): 3 Exiting the program. Goodbye!4. Write a menu-driven program in Python using user-defined function to find. @ Perimeter of a rectangle(2*length*breadth) © Circumference of a circle(2*3.14*r) def perimeter_rectangle (length, breadth) ;| return 2 * (length + breadth) def circumference_circle (radius) : return 2 * 3.14 * radius def main( while True: print ("\nMenu:") print("1. Calculate Perimeter of a Rectangle") print ("2. Calculate Circumference of a Circle”) print ("3. Exit") choice = input("Enter your choice (1/2/3): ") if choice == '1 length = float (input ("Enter the length of the rectangle: ")) breadth = float(input ("Enter the breadth of the rectangle: ")) perimeter = perimeter_rectangle (length, breadth) print (f"The Perimeter of the rectangle is: (perimeter:.2f}") elif choice == '2": radius = float (input ("Enter the radius of the circle: ")) circumference = circumference_circle (radius) print (f"The Circumference of the circle is: {circumference:.2f}") elif choice == '3': print ("Exiting the program. Goodbye break else: print ("Invalid choice! Please try again.") if _name 5 “main( "_main_' ourPUT Ment 1. Calculate Perimeter of a Rectangle 2. Calculate Circumference of a Circle 3. Exit Enter your choice (1/2/3): 1 Enter the length of the rectangle: 2 Enter the breadth of the rectangle: 2 The Perimeter of the rectangle is: 8.00 Ment 1. Calculate Perimeter of a Rectangle 2. Calculate Circumference of a Circle 3. exit Enter your choice (1/2/3): 2 Enter the radius of the circle: 2 The Circumference of the circle is: 12.56 Menu: 1. Calculate Perimeter of a Rectangle 2. Calculate Circumference of a Circle 3. Exit Enter your choice (1/2/3): 3 Exiting the program. Goodbye!5. Write a program to perform push and pop operations on a stack in Python. Ast = [{'New York, 'USA', 800], ["Paris', 'France', 900], ["Bilaspur', 'India', 1130]] travel=[1 def Push_element (1st): for E in 1st: if L(1) != ‘Indiat and L{2] < 1000: travel.append({L(0}, L(1]]) def Pop_element (): if Ten(travel) > 0: print ("Popped element: ",travel.pop()) else: print ("stack Empty") Push_element (1st) Pop_element () ourpuT Popped element: ['Paris', 'France'] 6. Write a program to count the number of vowels present in a text file. f=open("c://SQL.txt", "r") -read() for i in s: if i.lower() in ["a', 'e', "i", 'o', ‘u']: d=d+1 print ("Number of vowels: ", d) ourPUT Number of vowels: 91 7. Write a program to count the number of ‘this’(ignore case) sopen("c://SQL.txt", "r") «read() -split() w d=0 for i in w: if i.lower( d=d+1 print ("Number of 'this': ", d) ourPuT Number of 'this': 48. Write a program to write those lines which have the character “p”, from one text file to another text file. with open("source.txt", "r") as s: with open("destination.txt", "w") as d: for i in s: if 'p' in i.lower(): d.write (line) print ("Lines containing 'p' have been written to 'destination.txt'") 9. Write a program to count the number of words in a text file. f=open("c://SQL.txt", "r") s=f.read() w=s.split () print ("Number of words:", len(w)) ourpuT Number of words: 64 10. Write a program to get Roll no., Names and Marks of the students of a class and store these details in a file called marks.dat. import pickle list =[ ] f=open("marks.dat", "ab") roll= int(input ("Enter roll no: ")) name= input ("Enter Students's name: ") marks= int (input ("Enter marks: ")) 1=[roll, name, marks] pickle. dump (1, £) £.close() ourPuT Enter roll no: 4 Enter Students's name: hardik Enter marks: 7611. Write a program to display student's record of a class stored in a file called marks.dat import pickle try: with open("marks.dat", "rb") as print ("Records in the file: while True: try: record = pickle.load(f) print (record) except EOFError: break except FileNotFoundError: print ("The file does not exist.") ouTPUT Records in the file: [5, 'Kohli', 90] (1, 'kohli', 98] [2, 'Dhoni', 87] (3, "suresh", 100] [4, "hardik', 76] 12. Write a program to count the students of a class whose marks is greater than 90 stored in a file called “Marks.dat”. import pickle f=open("marks.dat", "rb") c=0 try: while True: x=pickle.load(f) if x[2]>90: Gres. except EOFError: f£.close() print ("Number of Student with >90 marks: ",c) ourpuT Number of Student with >90 marks: 2
You might also like
Class 12 Cs Project
PDF
No ratings yet
Class 12 Cs Project
32 pages
FFFFFFFFFFFFFVG
PDF
No ratings yet
FFFFFFFFFFFFFVG
65 pages
Cs PR 12
PDF
No ratings yet
Cs PR 12
56 pages
Computer Sci. Practical 2024-25
PDF
No ratings yet
Computer Sci. Practical 2024-25
52 pages
Cs Pro 1-8 - Merged
PDF
No ratings yet
Cs Pro 1-8 - Merged
37 pages
Report File 12
PDF
No ratings yet
Report File 12
33 pages
Priyanka Final Project
PDF
No ratings yet
Priyanka Final Project
71 pages
1.fibonacci Series: PGM - No:1 08/06/2023 Aim
PDF
No ratings yet
1.fibonacci Series: PGM - No:1 08/06/2023 Aim
73 pages
BADAPLINrecord
PDF
No ratings yet
BADAPLINrecord
83 pages
Lavender Buildings Social Media Report
PDF
No ratings yet
Lavender Buildings Social Media Report
44 pages
Siya CS Practical
PDF
No ratings yet
Siya CS Practical
34 pages
Part 1 Working With Functions
PDF
No ratings yet
Part 1 Working With Functions
50 pages
Practical File Sample 22-23 - Final - Final
PDF
No ratings yet
Practical File Sample 22-23 - Final - Final
38 pages
Computer Assignment
PDF
No ratings yet
Computer Assignment
39 pages
Grade 12 Physics Practical Manual
PDF
No ratings yet
Grade 12 Physics Practical Manual
24 pages
Computer Science Practical File Khyati Kedia
PDF
No ratings yet
Computer Science Practical File Khyati Kedia
68 pages
Computer Practical
PDF
No ratings yet
Computer Practical
42 pages
Prasuncsprac
PDF
No ratings yet
Prasuncsprac
75 pages
Practical File Cs
PDF
No ratings yet
Practical File Cs
43 pages
CS Project File.
PDF
No ratings yet
CS Project File.
38 pages
Python Practical Unit 1
PDF
No ratings yet
Python Practical Unit 1
11 pages
21 Program
PDF
No ratings yet
21 Program
21 pages
Vineet
PDF
No ratings yet
Vineet
39 pages
Computer Science Practical File
PDF
No ratings yet
Computer Science Practical File
55 pages
2022 23 AI ML Practical List
PDF
No ratings yet
2022 23 AI ML Practical List
9 pages
Aakarshit Gupta Practical File 12th B
PDF
No ratings yet
Aakarshit Gupta Practical File 12th B
26 pages
Class Xii Record CSC 2025-2026
PDF
No ratings yet
Class Xii Record CSC 2025-2026
24 pages
Ram Prakash
PDF
No ratings yet
Ram Prakash
53 pages
All Document Reader 1724857804883
PDF
No ratings yet
All Document Reader 1724857804883
6 pages
New12 Report File - 24 - 25
PDF
No ratings yet
New12 Report File - 24 - 25
91 pages
Python Lab
PDF
No ratings yet
Python Lab
19 pages
Practical File
PDF
No ratings yet
Practical File
16 pages
Shrawani
PDF
No ratings yet
Shrawani
29 pages
ASSIGNMENT
PDF
No ratings yet
ASSIGNMENT
34 pages
Arnam Program File
PDF
No ratings yet
Arnam Program File
15 pages
Computer Science
PDF
No ratings yet
Computer Science
33 pages
Fibonacci Series: Pgm:no 1 8/06/2023 Aim
PDF
No ratings yet
Fibonacci Series: Pgm:no 1 8/06/2023 Aim
65 pages
XI Computer Science Practicle File Questions and Answers
PDF
No ratings yet
XI Computer Science Practicle File Questions and Answers
23 pages
2023 24 - Practicalprograms (1 25)
PDF
No ratings yet
2023 24 - Practicalprograms (1 25)
31 pages
Solution of Practicals Class Xii Comp. Sci. 083 2021 22
PDF
No ratings yet
Solution of Practicals Class Xii Comp. Sci. 083 2021 22
37 pages
Raksha Xiics Practical 2022-23
PDF
No ratings yet
Raksha Xiics Practical 2022-23
53 pages
Practical File Computer Science - 24 - 25
PDF
No ratings yet
Practical File Computer Science - 24 - 25
25 pages
Final - AISSCE 2023 Class 12 A CS Journal Questions
PDF
No ratings yet
Final - AISSCE 2023 Class 12 A CS Journal Questions
33 pages
Solution-Of-Practicals-Class-Xii-Comp.-Sci.-083-2022-23 SV
PDF
No ratings yet
Solution-Of-Practicals-Class-Xii-Comp.-Sci.-083-2022-23 SV
33 pages
Computer Science Project 12 B
PDF
No ratings yet
Computer Science Project 12 B
26 pages
Python Programs
PDF
No ratings yet
Python Programs
79 pages
Python Journal
PDF
No ratings yet
Python Journal
64 pages
Abcd 1
PDF
No ratings yet
Abcd 1
53 pages
Python Lab File
PDF
No ratings yet
Python Lab File
32 pages
Cs Record File
PDF
No ratings yet
Cs Record File
19 pages
Assign 12th
PDF
No ratings yet
Assign 12th
14 pages
HHW IP - Merged
PDF
No ratings yet
HHW IP - Merged
10 pages
Write A Program That Multiplies Two Integer Numbers Without Using Operator, Using Repeated Addition
PDF
No ratings yet
Write A Program That Multiplies Two Integer Numbers Without Using Operator, Using Repeated Addition
15 pages
Lab Manual 1st Year (Updated)
PDF
No ratings yet
Lab Manual 1st Year (Updated)
35 pages
Python Programs
PDF
No ratings yet
Python Programs
5 pages
Python Lab
PDF
No ratings yet
Python Lab
19 pages
Class 12th Activity File Computer Science New
PDF
100% (1)
Class 12th Activity File Computer Science New
32 pages
2bPU Hindi S MANUAL Computer World
PDF
No ratings yet
2bPU Hindi S MANUAL Computer World
29 pages
Write A Program That Reads A Line and Prints Its Statistics Like
PDF
No ratings yet
Write A Program That Reads A Line and Prints Its Statistics Like
18 pages