ruby unless
unless number.even?
# runs if `number` is NOT even
else
# runs if `number` is even
end
ruby unless
unless number.even?
# runs if `number` is NOT even
else
# runs if `number` is even
end
ruby else if
x = 1
if x > 2
puts "x is greater than 2"
elsif x <= 2 and x!=0
puts "x is 1"
else
puts "I can't guess the number"
end
ruby if else
if true
"if statement"
elsif false
"else if, optional"
else
"else, also optional"
end
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us