My friend who is matt1020304050 is helping me learn to script, he started off with something easy which was the print command, and going on saying that you can turn a number into a string, variables, etc, all that basic stuff. But he showed me this
Rhyxus = 5 print(Rhyxus-1) Rhyxus = "5" print(Rhyxus-1)
now whats the difference here since one is in quotations?
Well, in that situation, there is no difference. I believe when you are attempting to add, subtract, multiply, or divide a string, it attempts to put it into a numerical value, which is what tonumber() does. Say if Rhyxus was equal to "5d", that would cause an error, since 'd' is not a numerical value. Quotations declare a string of text.
Example:
print("I am a string!")
An alternative way is by using the apostrophe's.
print('Still a string!')
So, you may be asking, what's the difference between an apostrophe and quotes? Well, I've got an answer. Say if I have a string of text, and I'm quoting what someone says, such as: Bill Gates said, "I like your shoes!". To put that in a variable, or print it, you'd need to use both apostrophes and quotes!:
print("Bill gates said, 'I like your shoes!'.")
That's about all you need to know about strings for now!