Set 147 Practical Question

⭐ Q49. File analysis – alphabets, spaces, lowercase, vowel starting words, 'hello' count

Example Code (Read Only):


text = f.read()
alph = sum(c.isalpha() for c in text)
spaces = text.count(" ")
lower = sum(c.islower() for c in text)
vowel_words = sum(w[0].lower() in "aeiou" for w in text.split())
hello_count = text.lower().count("hello")

Python Online Editor