Skip to content

Instantly share code, notes, and snippets.

@kellobri
Created January 5, 2015 19:37
Show Gist options
  • Save kellobri/e4a3f5e99fb2b0aea08b to your computer and use it in GitHub Desktop.
Save kellobri/e4a3f5e99fb2b0aea08b to your computer and use it in GitHub Desktop.
equalitiesDay0
print "1. "
puts 4 == 2 * 2
print "2. "
puts 6 > 4
print "3. "
puts (12 * 2) > 10
print "4. "
puts 3 == 3
print "5. "
puts (-1 > 0) && (2 <= 1)
print "6. "
puts 7 != 2
print "7. "
puts (8 <= 10) || (2 >= 3)
print "8. "
puts 9 % 2 == 1
print "9. "
puts 100 == 10 ** 2
print "10. "
puts 6 == 1000 / (300 / 2)
#I AM A COMMENT RUBY IGNORES ME BECAUSE MY LINE STARTED WITH A '#'
#Use the following variable msg for questions 11 - 15
msg = "hEllO"
print "11. "
puts msg.upcase == "HELLO"
print "12. "
puts msg.swapcase == "HeLLo"
print "13. "
puts msg.reverse == "OllEh"
arr = ['a', 'b', 'c']
print "14. "
puts 'c' == arr.last
print "15. "
puts 3 == arr.count
#Hint: This will take 2 method calls
print "16. "
puts arr[2].upcase == 'C'
hsh = { name: 'Fido', age: '99' }
print "17. "
puts hsh[:name] == 'Fido'
print "18. "
puts hsh.keys == [:name, :age]
@jah2488
Copy link

jah2488 commented Jan 5, 2015

Might need to look at #5 again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment