This code does not work properly,can any one help me?


#1

LEARN RUBY
this is the code:
print "What’s your first name? "
first_name = gets.chomp
first_name.capitalize!

these are the instruction-
Declare a variable first_name and set it equal to gets.chomp.

This checkpoint may seem like it’s running forever, but the terminal to the right is actually waiting for input because of gets.chomp. Answer the question in the terminal and press “Enter” or “Return” to finish checking your work.

link-https://www.codecademy.com/courses/learn-ruby/lessons/putting-the-form-in-formatter/exercises/getting-input?action=lesson_resume


#2

Be sure when you enter a name it does not have a capital letter at the beginning or capitalize will return nil.


#3

thanks,now code is running.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.