Created
April 22, 2013 22:47
-
-
Save chrismo/5439255 to your computer and use it in GitHub Desktop.
elsif
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
irb(main):001:0> a = 2 | |
=> 2 | |
irb(main):002:0> if a == 0 | |
irb(main):003:1> puts 'zero' | |
irb(main):004:1> elsif a < 2 | |
irb(main):005:1> puts 'less than 2' | |
irb(main):006:1> else | |
irb(main):007:1* puts 'greater than or equal to 2' | |
irb(main):008:1> end | |
greater than or equal to 2 | |
=> nil | |
irb(main):009:0> a = 1 | |
=> 1 | |
irb(main):010:0> if a == 0 | |
irb(main):011:1> puts 'zero' | |
irb(main):012:1> elsif a < 2 | |
irb(main):013:1> puts 'less than 2' | |
irb(main):014:1> else | |
irb(main):015:1* puts 'greater than or equal to 2' | |
irb(main):016:1> end | |
less than 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment