write a program to content of the file and display uppercase character and digits in the python
Answers
Answer:
Use a for loop to traverse through the characters in the string and increment the first count variable each time a lowercase character is encountered and increment the second count variable each time a uppercase character is encountered. 4. Print the total count of both the variables.
Answer:
file=open("c:\python programs\\test.txt")
doc=file.read()
uppercase_count=0
for i in doc:
if(i=='A'or i=='B'or i=='C'or i=='D'or i=='E'or i=='F'or i=='G'or i=='H'or i=='I'or i=='J'or i=='K'or i=='L'or i=='M'or i=='N'or i=='O'or i=='P'or i=='Q'or i=='R'or i=='S'or i=='T'or
i=='U'or i=='V'or i=='W'or i=='X'or i=='Y'or i=='Z'):
uppercase_count+=1
print("The total number of uppercases =",uppercase_count)
Explanation:
Mark as BRAINLIST plzzz