Python Programming
Assignment 2
Note: 1) The submission date for this assignment is 08/11/2025.
2) This assignment is to be written on A4 sheets only.
3) Please try to write the answers to subjective questions in your own words.
4) Write codes for programming questions in Python only using proper syntax.
1) Discuss the steps involved in reading data from a file and writing data to another file.
2) What is recursion? Explain with an example where recursion is more suitable than
iteration.
3) Create a function that accepts a list of tuples, where each tuple contains a student’s
name and marks in three subjects. The function should:
● Calculate the total and average marks.
● Return a dictionary with student names as keys and averages as values.
● Display names of students (in title case) and average marks up to 2 decimal
places scoring above 75% using a set.