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 is frozen set in python?

0 Answers  


Which data type you prefer to implement when deal with seuential data?

0 Answers  


What is timestamp in python?

0 Answers  


What is the statement that can be used in python if the program requires no action but requires it syntactically?

0 Answers  


What are negative indices?

0 Answers  


What does echo do python?

0 Answers  


What is static in python?

0 Answers  


What’s the difference between raw_input() and input() in python3.x?

0 Answers  


What is the best python interpreter?

0 Answers  


What are the differences in xrange and range?

0 Answers  


How will you check if all characters in a string are alphanumeric?

0 Answers  


Who created python?

0 Answers  


Categories