Substrings and Highest score, python
10:20 16 Jan 2026

enter image description here

Question 2: Substring
You are given a text file containing a list of strings, one string per line. Write a Python program

that reads the strings from the input file and writes to an output file all strings that appear as a

substring of at least one other string in the list.

Question 3. Highest score

Given a file scores.csv containing the columns student_id, subject, and score,

write a Python function highest_score(student_id) that takes a student_id as input

and returns the subject in which that student achieved the highest score.

Additional requirement: After defining the function, your program must call the function

from the main body and print the returned result

python file substring