Skip to content

Instantly share code, notes, and snippets.

@arthur-littm
Created October 3, 2017 10:07
Show Gist options
  • Save arthur-littm/3b886fee71b999a6c99e9b4b4f3d0b54 to your computer and use it in GitHub Desktop.
Save arthur-littm/3b886fee71b999a6c99e9b4b4f3d0b54 to your computer and use it in GitHub Desktop.
age = 23
# *Assign* the value 23 to my variable `age`
puts "a year as passed"
# *Re-assigning* the value of the variable `age`
age = age + 1
# age += 1
# Interpolating the variable `age` inside a string
puts "I am #{age} years old"
# first_name = "arthur"
# last_name = "littmann"
def full_name(first_name, last_name)
"#{first_name.capitalize} #{last_name.upcase}"
end
puts "What's your first name ?"
first = gets.chomp
puts "Lastname ?"
last = gets.chomp
puts full_name(first, last)
require 'date'
# def say_hello(name)
# return "Hello #{name}!"
# end
# puts say_hello("Arthur")
# puts say_hello("Alex")
# puts say_hello("Edward")
# puts say_hello("Sandrine")
def full_name(first_name, last_name)
full_name = "#{first_name.capitalize} #{last_name.upcase}"
return full_name
end
first = "alex"
last = "benoit"
puts full_name(first, last)
# def tomorrow
# tomorrow = Date.today + 1
# return tomorrow.strftime("%A, %b %d")
# end
# puts tomorrow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment