Computer Science, asked by sahibsaifi12291, 4 months ago

Write a program in Python to count the number of lines in a text file “SPS.TXT” which is starting with

an alphabet ‘A’.

Answers

Answered by Anonymous
2

Answer:

hello ,

Explanation:

# python program to count the number of lines in a text file starting with 'A'.

f=open("SPS.TXT","r")

s=f.readlines()

count=0

for i in s:

   if i[0][0].upper()=="A":

       count+=1

print (count,"number of lines starts with A")

hope it helps you... XD

please mark brainliest

@ItzSnowySecret07

Similar questions