Skip to content

Instantly share code, notes, and snippets.

@NevadaKiran
Created March 19, 2015 18:32
Show Gist options
  • Save NevadaKiran/68e851d16e4cfc0180a6 to your computer and use it in GitHub Desktop.
Save NevadaKiran/68e851d16e4cfc0180a6 to your computer and use it in GitHub Desktop.
letters = "a"
vowels = ["a", "e", "i", "o", "u"]
# Loop through each letter and print whether it is a vowel or consonant
# letters.each_with_index do |letter, index|
# if letter == "a" || letter == "e" || letter == "i" || letter == "o" || letter == "u"
# puts "vowel at index #{index}"
# else
# puts "consonant at index #{index}"
# end
# end
# Loop each letter and print whether it is a vowel or a consonant.
letters.each_with_index do |letter, index|
puts vowels
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment