Class 12 Computer Science

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

DTEA SR. SEC.

SCHOOLS

XIIth COMPUTER SCIENCE(083)

HOLIDAY HOMEWORK (2023-24)


Q1. Write a program that creates a list of all the integers less than 100 that are multiples of 3 or 5.

Q2. Write a program that creates a tuple sorting first 9 terms of Fibonacci series.

Q3. Write a program that checks for a presence of a value inside a dictionary and print its key.

Q4. Write a program that calculates and prints number of seconds in a year.

Q5. Write a program that prints longest words in a list of words.

Q6. Write a program to have a function that takes amount-in-dollars and dollar-to-rupee conversion
price; then it returns the amount converted to rupees. Create the functions both in void and non-void
forms.

Q7. Write a program to have a function that takes two numbers and returns the number that has
minimum one’s digit.

Q8. Write a program to have a function that takes number as argument and calculates square for it. The
function does not return a value. If there is no value passed to the function in function call, the function
should calculate cube of 2.

Q9. Write a program that receives two numbers in a function and returns the result of all arithmetic
operations (+,-,*, /,%) on these numbers.

Q10. Write a program to have a function to calculate a volume of box with appropriate default values
for its parameters. Your function should have following input parameters:

a) Length of a box
b) Width of a box
c) Height of a box

Q11. Write a program in python to copy the alternate lines from file “data.txt” to “story.txt”.

Q12. Create a binary file student.dat to hold students’ records like Roll_no., Students name, and Address
using the list. Write functions to write data, read them, and print on the screen.

Q13. Write a program to read and write programming languages stored in the tuple to binary file PL.dat

Q14. Write a program to write into file “one.csv” Rollno, Name and Marks separated by comma. It
should have header row and then take in input from the user for all following rows. The format of the
file should be as shown if user enters 2 records.

Roll.No,Name,Marks
20,ronit,67
56,nihir,69
Q15. Write a program in python to count those lines from the file “poem.txt” which are starting from ‘P’
or ‘S’.

You might also like