Skip to content

Instantly share code, notes, and snippets.

@hawz
Created June 20, 2019 07:57
Show Gist options
  • Save hawz/91d9018e50c7a31d664192fce76833ed to your computer and use it in GitHub Desktop.
Save hawz/91d9018e50c7a31d664192fce76833ed to your computer and use it in GitHub Desktop.
# Analyzer.rb - Getting input from user
p "What is your first name?"
first_name = gets.chomp
puts "What is your last name?"
last_name = gets.chomp
# String Interpolation
full_name = "#{first_name} #{last_name}"
# Output
p "Your full name is #{full_name}"
p "Your full name reversed is #{full_name.reverse}"
p "Your full name has #{first_name.length + last_name.length} characters in it"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment