Quotes help make search much faster. Example: "Practice Makes Perfect"

Monday, November 19, 2012

Codecademy: "Formatting with String Methods"


#sample solution


print "What's your first name?"
first_name = gets.chomp.capitalize!
print "What's your last name?"
last_name = gets.chomp.capitalize!
print "What's the name of your city?"
city = gets.chomp.capitalize!
print "What's the abbreviation for your state/province?"
state = gets.chomp.upcase!

print "The variables are #{first_name}, #{last_name}, #{city}, #{state}"

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts