mirror of
https://github.com/gnh1201/caterpillar.git
synced 2025-03-12 17:05:16 +00:00
Update server.py
This commit is contained in:
parent
50b15bcdab
commit
844bb2f108
|
@ -469,8 +469,8 @@ def calculate_vowel_ratio(s):
|
|||
if length == 0:
|
||||
return 0.0
|
||||
|
||||
# Count the number of vowels ('a', 'e', 'i', 'o', 'u') in the string.
|
||||
vowel_count = sum(1 for char in s if char.lower() in 'aeiou')
|
||||
# Count the number of vowels ('a', 'e', 'i', 'o', 'u', 'y') in the string.
|
||||
vowel_count = sum(1 for char in s if char.lower() in 'aeiouy')
|
||||
|
||||
# Calculate the ratio of vowels to the total length of the string.
|
||||
vowel_ratio = vowel_count / length
|
||||
|
|
Loading…
Reference in New Issue
Block a user