Skip to content

Commit 663000e

Browse files
authored
Vowel count in a given String! (#242)
* vowel count in a given String! * Character frequency count in a given String
1 parent 6706f42 commit 663000e

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""
2+
@author: Abhishek Reddy
3+
@date: 30/01/2019
4+
"""
5+
# Identifying the character which has the highest frequency in given string
6+
7+
inp = input("String to identify frequently appearing character: ")
8+
countChars = [inp.count(i) for i in inp]
9+
print(inp[countChars.index(max(countChars))])

day4/Python/AR_Day4_VowelCount.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""
2+
@author : Abhishek Reddy
3+
@date : 30/01/2019
4+
"""
5+
6+
# "[a,e,i,o,u]" are the set of vowels in English language
7+
8+
inp = input("String to calculate vowels:")
9+
vcount = 0
10+
for i in inp:
11+
if i=='a' or i == 'e' or i=='i' or i=='o' or i=='u' or i=='A' or i=='E' or i=='I' or i=='O' or i=='U':
12+
vcount += 1
13+
print(vcount)

0 commit comments

Comments
 (0)