Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- text = """stagnating ; just as a small mountain brook, coming
- to a hollow, might stop, and sink from sight,
- through not having a will to find a way through that
- obstruction ; or around it. You will run across such
- a dormant town, occasionally; possibly so dormant
- that only outright isolation by a fast-moving world,
- will show it its folly. If you will tour Asia, Yuca-
- tan, or parts of Africa and Italy, you will find many
- sad ruins of past kingdoms. Go to Indo-China and
- visit its gigantic Ankhor Vat; call at Damascus,
- Baghdad and Samarkand. What sorrowful lack of
- ambition many such a community shows in thus dis-
- carding such high-class construction! And I say,
- again, that so will Youth grow dormant, and hold
- this big, throbbing world back, if no champion backs
- it up ; thus providing it with an opportunity to show
- its ability for looking forward, and improving un-
- satisfactory conditions."""
- # count "e" in the text
- checkE = text.count("e")
- if checkE != 0:
- print (checkE)
- else:
- print("There is no e in the text")
- # count overall characters
- overall = text.count("")
- print("overall count is:", overall)
- # count letters in text only
- mod_text = []
- i = 0
- for x in text:
- if text[i].isalpha() == True:
- mod_text.append(text[i])
- i = i+1
- print(mod_text)
- overall_let = len(mod_text)
- print("overall letter count is:", overall_let)
- # count AUIC in text
- AC = mod_text.count("a")
- UC = mod_text.count("u")
- IC = mod_text.count("i")
- OC = mod_text.count("o")
- print("The letter A appears :", AC, "times")
- print("The letter U appears :", UC, "times")
- print("The letter I appears :", IC, "times")
- print("The letter O appears :", OC, "times")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement