Skip to content

Commit ee3a43e

Browse files
authored
Create 3813. Vowel-Consonant Score.py
1 parent 385bec3 commit ee3a43e

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
class Solution:
3+
def vowelConsonantScore(self, s: str) -> int:
4+
arr =['a','e','i','o','u']
5+
cha = 0
6+
aeiou = 0
7+
8+
for ch in range(len(s)):
9+
temp = s[ch]
10+
if temp in ('a','e','i','o','u'):
11+
aeiou+=1
12+
else:
13+
if ord(temp)>=97 and ord(temp)<=122:
14+
cha+=1
15+
16+
if cha==0:
17+
return 0
18+
else:
19+
return aeiou//cha
20+
21+
22+
23+
solution = Solution()
24+
s = 'i3'
25+
print(solution.vowelConsonantScore(s))

0 commit comments

Comments
 (0)