Created
October 3, 2017 10:07
-
-
Save arthur-littm/3b886fee71b999a6c99e9b4b4f3d0b54 to your computer and use it in GitHub Desktop.
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
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" |
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
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) |
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
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