Terminal printing variables when it shouldn't


#1



Whenever I declare a variable or multiple variables on the online editor the terminal will print the last variable declared, even though I'm not putting a print statement in.

For example: here's a screenshot

Why is this happening? This isn't ruby behavior is it?


my_num = 25

my_boolean = true

my_string = "Ruby"


#2

no, it is not. Codecademy prints this last variable. Nothing to worry about


#3

The terminal (irb), not "Ruby", is printing the value of the program.
This is desired behaviour. If you would run your script as a Ruby
program, nothing would be printed.


#4

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