-- Made by Lunatic_o;
io.write("Hello, world!\n");
print("Hello, world!");
What is the difference? Does here exist two methods to do the same thing?
-- Made by Lunatic_o;
io.write("Hello, world!\n");
print("Hello, world!");
What is the difference? Does here exist two methods to do the same thing?
Simple:
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
But i still can print using "\n". Is this an exception?
Yes, i suppose so. But print() can't use formats. It's not that smart.
This is wrong. Neither can use formats. Both output text verbatim to standard output.
'\n'are not formats but "escape sequences", which serve as a way to introduce special characters like new lines or TABs'\t'. The difference isprint()will add a newline,io.write()will not.