6. Can we chain method to gets.chomp?


#1

It seems less redundant as we would save a line of code. It works in the browser, but the answer not accepted, so my question is, is this frowned upon?

example #1 only 2 lines of code

print "What's your name?"
first_name = gets.chomp.capitalize!

example #2 has 3 lines of code

print "What's your name?"
first_name = gets.chomp
first_name.capitalize!


#2

No, they just want you do to it a certain instructed way, outside of Codecademy I chain them like Example 2.