Write a program to count the number of upper- case alphabets present in a text file "Article.txt".

Опубликовано: 17 Июль 2026
на канале: Portal Express
3,083
47

Write a program to count the number of upper- case alphabets present in a text file "Article.txt".

Website Link :-
https://www.pathwalla.com/2020/03/q-5...

File Handling || Q 5 || Type C || Sumita Arora || Class 12 || Computer science || IP || Solution

File Handling Playlist link ---

   • Write a program that reads a text file and...  

Answer :-

count = 0

file = open("Article.txt","r")
sen = file.read()
for i in range ( len(sen) ) :
if sen[ i ].isupper() :
count += 1

print("Number of upper case alphabet : ", count)
file.close()

Article.txt Contains :-

A boy is playing there.
There is a playground.
An aeroplane is in the sky.
Alphabets & numbers are allowed in password.
This is Path Walla Website..

Output :-

Number of upper case alphabet : 8

#filehandling #class12sumitaarora


computer science class 12 python,
class 12 cs sumita arora solutions,
file handling class 12 python
file handling class 12 questions