Anonymous0069

Basic_operations_with_TXT_file(Python)

Aug 9th, 2023 (edited)
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | Source Code | 0 0
  1. a= open(r"C:\Users\user\Desktop\myfile.txt")
  2. line1= a.readline()
  3. total_uppercase_letters=0
  4. total_lowercase_letters=0
  5. for i in line1:
  6.     if i.isupper():
  7.         total_uppercase_letters+=1
  8.     elif i.islower():
  9.         total_lowercase_letters+=1
  10.        
  11. print("total no. of capital letters are :  ",total_uppercase_letters)
  12. print("total no. of lower case letters are :  ",total_lowercase_letters)
  13. a.close()
  14.  
Advertisement
Add Comment
Please, Sign In to add comment