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
6
Answer:
file = open("student.txt", "r")
data = file.read()
occurrences = data.count("Lucknow")
print('Number of occurrences of Lucknow :', occurrences)
Explanation:
Similar questions