What is the difference between these two


#1

print "what is your last name?"
last_name = gets.chomp
last_name.capitalize!

and

print "what is your last name?"
last_name = gets.chomp
last_name2 = last_name.upcase
last_name.upcase!


#3

It is saying that we can add a method that modify the value using:

variable.method! (here you can't use gets or chomp, just methods that change the variable)
or
variable2 = variable.capitalize

In both case you will need a variable = gets.chomp(optional) before.