Write a function to count the number of alphabets present in a text file “NOTES.txt”.
Answer:
def count_alpha():
c=0
f=open("Notes.txt",'r')
l=f.readlines()
for line in l:
for word in line:
for char in word:
if char.isalpha():
c=c+1
print("Number of alphabets = "+str(c))
f.close()