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 write a text from from another text file in python ?

0 Answers  


Can a set be sorted python?

0 Answers  


What is python distutils?

0 Answers  


What is sphinx in python?

0 Answers  


What is pass in Python?

0 Answers  


How do you write a simple code in python?

0 Answers  


How is a .pyc file different from a .py file?

0 Answers  


what does yield function do? what is the difference between return and yield?

1 Answers  


How does the ternary operator work in python?

0 Answers  


What is a means by “tuple in python”?

0 Answers  


What is python __ repr __?

0 Answers  


What are global variables in python?

0 Answers  


Categories