Computer Science, asked by shiviii1703, 9 months ago


Write a function in Python to read lines from a text file "student.txt", to find and display the
occurrence of the word "Lucknow".

Answers

Answered by testdummyhere1212
6

Answer:

file = open("student.txt", "r")

data = file.read()

occurrences = data.count("Lucknow")

print('Number of occurrences of Lucknow :', occurrences)

Explanation:

Similar questions