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
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
Math,
2 months ago
Math,
2 months ago
Math,
2 months ago
Math,
4 months ago
Environmental Sciences,
4 months ago
Chemistry,
10 months ago
Chemistry,
10 months ago
India Languages,
10 months ago