Skip to content

Instantly share code, notes, and snippets.

@PandaWhisperer
Created October 9, 2017 18:27
def countwovels(str)
for vowel in 'aeiouAEIOU'.chars
count = str.count(vowel)
if count == 1
puts "#{vowel} appears #{count} time."
elsif count >= 2
puts "#{vowel} appears #{count} times."
end
end
end
str = 'All animals are equal but some are more equal than otheres.'
countwovels(str)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment