Created
March 1, 2019 02:51
-
-
Save RickArora/24253ea360e63e2c89babd6d9bb7401b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Write a method, `only_vowels?(str)`, that accepts a string as an arg. | |
# The method should return true if the string contains only vowels. | |
# The method should return false otherwise. | |
def only_vowels?(vowels) | |
vowels.split.all? { |letter| "aeiou".include?(letter) } | |
end | |
p only_vowels?("aaoeee") # => true | |
p only_vowels?("iou") # => true | |
p only_vowels?("cat") # => false | |
p only_vowels?("over") # => false | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment