After using puts and print statement I get nil in my display which I don't even type


#1


ttps://www.codecademy.com/courses/ruby-beginner-en-d1Ylq/0/5?curriculum_id=5059f8619189a5000201fbcb


Replace this line with your code.


#2

This extra output is very usual at ruby programs in Codecademy, you don't have to care about it for now.


#3

Hi @jishandesai,

It's default Ruby behavior for puts and print to return nil at the end. Alex J has written about it here:

https://www.codecademy.com/en/forum_questions/52a112378c1cccb0f6001638#answer-52a1981d52f863d3de00013c

nil is the Ruby object that represents nothingness. Whenever a method doesn’t return a useful value, it returns nil. puts and print are methods that return nil:


#4

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