Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
18 views24 pages

Computer Science Practical File222

The document is a practical file for a Computer Science course by Shray Mittal, detailing various programming assignments. It includes tasks such as computing powers, generating Fibonacci series, and manipulating strings and files using Python. Each task is a programming exercise aimed at developing skills in coding and data management.

Uploaded by

shraybbps1234
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)
18 views24 pages

Computer Science Practical File222

The document is a practical file for a Computer Science course by Shray Mittal, detailing various programming assignments. It includes tasks such as computing powers, generating Fibonacci series, and manipulating strings and files using Python. Each task is a programming exercise aimed at developing skills in coding and data management.

Uploaded by

shraybbps1234
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/ 24

Computer Science Practical File

Name- Shray Mittal

Class- XII A

Roll No.- 7

Submitted To- Ms. Harpreet Kaur


Q1 WAP to compute x^n of given two
integers x and n.
Q2 WAP to print Fibonacci series up to
certain limit using user-defined module.
Q3 Write a Program to find factorial of entered
number using user-defined module fact()
Q4 WAP to accept a number, find and display
whether it’s a Armstrong number or not
.
Q5) WAP to accept a number and find out
whether it is a perfect number or not.
Q6) WAP to print the following pattern:
1
12
123
1234
12345
Q7) WAP that counts the number of alphabets and
digits, uppercase letters, lowercase letter, spaces
and other characters in the string entered.
Q8) WAP to accept a string ( a sentence) and returns a
string having first letter of each word in capital letter.
Q9 WAP to remove all odd numbers from the given
Index list.
Q10) WAP to display cumulative elements of a given
list.
.
Q11) WAP to display frequencies of all the elements
of a list.
Q12) WAP to create a CSV file to store student
data(Rollno, Name, Marks). Obtain data from user and
write 5 records into file
.
Q13) Write a function in Python to count the number of
lines in a text file “STORY.TXT” which is starting with an
alphabet ‘A’.
Q14) Write a function that reads a text file and prints only
the numbers or digits from the file.
Q15) Write a function that copies a text file source.txt
onto target.txt barring the lines starting with ‘a’.
Q16) A binary file “Book.dat” has structure [bookno,Book_name, Author, Price]. Write a menu driven program. a. To
write a function CreateFile() to input data and add in Book.dat. b. To write a function CountRec(Author) in python
which accepts the Author name as parameter and count and return the number of books by th given Author c. To
write a function to update the price of book having bookno passed as parameter Update(bookno).
Q17) A csv file teacher.csv contains details (Teacherid, Teachername,
subjecttaught and salary) and write a menu driven python program
a. To take input from user and add records in csv file.
b. To update salary of teacher.
Q18) Write a menu based program to Maintaining Book details
like bcode, btitle and price using stacks in python. Write functions
to perform push, pop and display methods.
Q19) Write a menu based program to add, delete and display the record of
hostel using list as stack data structure in python. Record of hostel
contains the fields :Hostel number, Total Students and Total Rooms.

You might also like