# This is a Number
25
# This is a Boolean
true
# This is a String
"ruby"
# This is a Nil
nil# Addition
1 + 2
# Subtraction
1 - 2
# Multiplication
1 * 2
# Division
1 / 2
# Exponent
2 ** 2
# Module
5 % 4 puts "What's up?"
puts "Bandid@"
puts "==========="
print "What's up? "
print "Bandid@"puts "The result is #{1+2}"# Single-Line Comments
# Hi!
# Multi-Line Comments
=begin
Hi,
How are You?
=end"I love espresso".length
"Ruby".reverse
"ruby".upcase
"RUBY".downcase
"Ruby".reverse.upcase
5.even?
5.to_s
5.to_rnumber = 1
puts number
# Reusing variable names
number = 4
number = number * 3
puts number + 2# Equals
==
# Not equal
!=
# Greater than
>
# Less than
<
# and
&&
# or
||
# negation
!# Codeable Applications
age = 18
if age >= 18
puts "Sure you can apply for codable"
else
puts "You still can't bandid@"
end# .loop
i = 1
loop do
i += 1
print "#{i}"
if i == 10
break
end
end# .while
counter = 1
while counter < 11
puts counter
counter = counter + 1
end# .untill
counter = 1
until counter > 10
puts counter
counter +=1 # operadores de asignación
end# .for
for num in 1...10
puts num
end
# .each
(1..10).each do |x|
x += 10
puts "#{x}"
end# .times
5.times { puts "I am learning to code!"}