Computer Science, asked by tonydhaka123, 6 months ago

.Write a user-defined function in python that displays the number of lines starting
with 'M' in the file hello.txt.​

Answers

Answered by Anonymous
6

Answer:

def countH():

f = open ("Para.txt", "r")

lines =0

l =f.readlines()

for i in l:

ifi[0]=='H':

lines+=1

print "no. of lines is",lines

Explanation:

MARK ME AS A BRAINLEIST

AND FOLLOW ME AND THANKS MY ANSWER PLEASE

Similar questions