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.
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 |
What are python libraries? Name a few of them.
What is monkey Patching in python?
What is sub() function?
What is python coded in?
How do you perform pattern matching in python? Explain?
What is a control flow statement?
What is python idle used for?
What is the best web framework for Python?
Why does python use self?
What does the *args do in python?
How long do goats sleep?
What is a Pandas Series, and what? does it entail