Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Write a one-liner that will count the number of capital letters in a file. Your code should work even if the file is too big to fit in memory.



Write a one-liner that will count the number of capital letters in a file. Your code should work eve..

Answer / mahesh

len([c for l in open('foo.txt') for c in l if c.isupper()])

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

How to walk through a list in a sorted order without sorting the actual list?

0 Answers  


What is string replication operator in python?

0 Answers  


What is the meaning of def in python?

0 Answers  


Mention the use of // operator in Python?

0 Answers  


How to find whether string is alphanumeric or not?

0 Answers  


Do sheeps sleep?

0 Answers  


What is difference between raw_input and input in python?

0 Answers  


How do you calculate the length of a string?

0 Answers  


What are python variables?

0 Answers  


What do (lambda) function closures capture in python?

0 Answers  


Is nodejs faster than python?

0 Answers  


What does len () mean in python?

0 Answers  


Categories