0% found this document useful (0 votes)
11 views2 pages

Functions File Handling

Uploaded by

shahana K
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)
11 views2 pages

Functions File Handling

Uploaded by

shahana K
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/ 2

CLASS XII - Practise questions

TOPIC: CLASS XI PORTIONS (Python Revision Tour 1 & 2)

Shree Niketan Patasala, Mannivakkam


Grade 12 – Computer Science
Revision Slip Test – Terminal Exam
CH - 3: WORKING WITH FUNCTIONS
Date: 03.08.2025 Marks: 15
1. What are default arguments? Explain with an example. (2)
2. Differentiate between parameters and arguments with an example. (2)
3. Explain local and global arguments with examples. (2)
4. Explain the types of functions supported by Python. (2)
5. Write a function min_digit(), which takes two numbers as parameters and
returns the number that has the minimum value in its one’s digit. (3)
6. (i) Write a function to check whether a number is a palindrome or not, without
converting it into a string. (3)
(ii) Find the output: (1)
Num = 25
def calc():
Num=20
print(Num, end= ‘ ’)
calc()
print(Num)

FILE HANDLING Marks: 15


1. Write a program in Python, which reads a text file and counts and displays the
number of four-letter words in the file “POEM.TXT”. (2)
2. Write a menu-driven program using user defined functions for each task given
below, using the text file “Story.txt”.
● Display the longest word from the file.
● Display the longest sentence from the file. (4)
3. Differentiate between the following: (6)
(i) tell() and seek()
(ii) load() and dump()
(iii) writerow() and writerows()
4. A binary file, “student.dat” contains information in the form: [rno, name, mark1,
mark2, mark3]. Write a function to search for a particular student and update mark3.
Give an appropriate message, if the roll_no is not found. (3)

5. Write a program to create a binary file from “employee.dat”, which has the structure,
[emp_id, emp_name, dept, salary]. Write another function Incr_salary() to update the
salary of employees belonging to the “Sales” department. (5)

You might also like