A boy is playing there.
There is a playground.
An aeroplane is in the sky.
Alphabets & numbers are allowed in password.
the function should display the output as 3.
# Code
def func(l): # function to count lines starting with ‘A’
c = 0 # c is the count of such lines
for line in l:
if line[0] == ‘A’
c += 1
return c
f1 = open(‘LINES.txt’, ‘r’)
l = f1.readlines() # creates a list of all the lines in the file
print(‘Number of lines starting with A in the file LINES.txt is’, func(l))