The print
method is used to print values to the console. It is similar to the puts
and $stdout
methods.
print data
data
: The data we want to print to the console.The value returned is printed data on the console.
Let's look at the code below:
# create some variablesname = "Okwuidili"age = 1000# print data to the consoleprint nameprint "\n#{age}"print "\nwelcome to edpresso!"