Prints nil: the variable exists but is not assigned : print « Development « Ruby






Prints nil: the variable exists but is not assigned


a = 0.0 if false    # This assignment is never executed
print a             # Prints nil: the variable exists but is not assigned
print b             # NameError: no variable or method named b exists

 








Related examples in the same category

1.print Statement
2.print vs puts