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

What are python libraries? Name a few of them.

0 Answers  


What is monkey Patching in python?

0 Answers  


What is sub() function?

0 Answers  


What is python coded in?

0 Answers  


How do you perform pattern matching in python? Explain?

0 Answers  


What is a control flow statement?

0 Answers  


What is python idle used for?

0 Answers  


What is the best web framework for Python?

0 Answers  


Why does python use self?

0 Answers  


What does the *args do in python?

0 Answers  


How long do goats sleep?

0 Answers  


What is a Pandas Series, and what? does it entail

2 Answers  


Categories