Skip to content

Instantly share code, notes, and snippets.

@k41n3w
Created December 31, 2023 17:56
Show Gist options
  • Save k41n3w/11d077be45f3d0e988ee95706d4dc764 to your computer and use it in GitHub Desktop.
Save k41n3w/11d077be45f3d0e988ee95706d4dc764 to your computer and use it in GitHub Desktop.
Código 8 - Post de 'Passagem de parâmetros em Ruby"
name = "Sávio"
age = 54
def greet(name, age)
name = "Sr. #{name}"
age = "#{age} anos de idade!"
puts "Olá, #{name}! Você tem #{age}"
end
greet(name, age)
# Retorno: "Olá, Sr. Sávio! Você tem 54 anos de idade!"
puts name
# Retorno: "Sávio
puts age
# Retorno: "54"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment